• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » EXCEL Null String vs. UPCASE

#1 2010-01-15 19:25:35

jrbozeman587
New member
Company: State of Tennessee
Registered: 2009-03-23
Posts: 1

EXCEL Null String vs. UPCASE

Using TOS
Windows XP Professional
MS Office 2002
IBM Mainframe DB2
I am trying to copy data from an Excel file to DB2 using tMap and need to convert a field to uppercase.  Some of the input fields are null and the UPCASE function throws a NullPointerException.  Do you know how to code around this and where to plug the code into Talend?  I am using the Java option, even though I don't know Java.

Offline

#2 2010-01-15 20:30:29

rbaldwin
Member
Registered: 2008-11-24
Posts: 126

Re: EXCEL Null String vs. UPCASE

In the area where you're attempting to upper case the string, try the following: <column> == null ? null : StringHandling.UPCASE(<column>).  So, if you currently have an expression editor (text box) with the following:
StringHandling.UPCASE(row1.name)
You'd replace it with:
row1.name == null ? null : StringHandling.UPCASE(row1.name)

What this will do is essentially the following:
if row1.name is null
return null
otherwise
return StringHandling.UPCASE(row1.name)

Hope that answers your question.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » EXCEL Null String vs. UPCASE

Board footer

Powered by FluxBB