Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to convert integer to string datatype for a column which has some null values and the data gets loaded, but keep getting java.lang.NullPointerException in my Run window. What causes this even the data is loaded to the output table?
Doing conversion in tmap using Relational.ISNULL(row1.column)?nulltring.valueOf(row1.column)
In Tmap, output column is selected as string.
Make sure in your output ... the new column is able to except null values, so if its an existing table... make sure null is allowed.
row1.column = null
String.valueOf(row1.column) will return "null"
try this:
row1.column==null ? null : ""+row1.column
or:
row1.column==null ? null : Integer.toString(row1.column)
Make sure in your output ... the new column is able to except null values, so if its an existing table... make sure null is allowed.
row1.column = null
String.valueOf(row1.column) will return "null"
try this:
row1.column==null ? null : ""+row1.column
or:
row1.column==null ? null : Integer.toString(row1.column)
I've tried both of these commands and it still gives me the same error.
NOTE: It does load null values to the output table, but the error still comes up in the run window. Total # of input records matches the output load records.
Here are the screen shots of my job. Yes, I'm getting the error message in the Run console.