Column 'ColumnName' cannot be null error: though schema set to accept
Hello,
I can't seem to get rid of NULLs appearing in my job (and stopping the mapping due to the above error)
At first I had "Nullable" unchecked, so I can understand the error...
Then I checked Nullable and also gave my fields default values as well (then removed the default values)
Still when I run the job I get the Column 'ColumnName' cannot be null
Ideally I'd like to actually make them not null, but place a default value in them as part of the ETL
Thank You
Hi,
Could you please elaborate your case with an example with input and expected output values? flow?
Usually, you can transform the data on tMap component, If there are some values And null values(Empty) in your input source.
Write the expression on the output table of tMap like:
row1.columnName==null||row1.columnName.equals("")?"default":row1.columnName
Check the nullable box of the column on the schema if you want to compare the object is null or not.
The expression should be: row1.columnName==null?null:row1.columnName
Best regards
Sabrina
Hi, How is the column defined in your database schema? Does it allow null values? Not sure if you checked this already but wanted to mention it - I just had a similar scenario. Tom
Hi!
I have a simlar problem with Null values. In my case I need to concatenate two fileds, Christan Name and Last Name. The null values do not disapper in my output file. The filed Efternamn (last name) sometime is empty and cases the null values.
row1.FOERNAMN+" "+(row1.EFTERNAMN ==null?null:row1.EFTERNAMN)
What might be wrong in my formula.
BR
Krister
Hi Krister,
Your input is empty and not null. So, check for the length of input for that column and set empty if true else set actual.
row1.FOERNAMN+" "+(StringHandling.LEN(row1.EFTERNAMN) < 1?"":row1.EFTERNAMN)
Thanks
Vaibhav