Six Stars

tmap update with null value and not equals function

Hello, 

 

I would like to know if it's possible or not to update field with null value in tMap .

 

I use this :!row1.NOM.equals(row5.NOM) to compare row1(source table) and row2(target table) if I have updated values. It works if I have not null value or empty value but it doesn't work with null or empty value...

 

Can someone help me how I can figure that with tmap or explain me an other way?

 Any help would be really appreciated

 

Thank you.

 

 Version of Talend :Talend Open Studio for Data IntegrationVersion: 6.3.1

 

Capture.PNG

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ten Stars

Re: tmap update with null value and not equals function

You'll have to test for null values before comparing the two values to each other (ex: row1.NOM != null) or else replace null values with empty strings. You can replace nulls using a tMap by changing the output expression for a column from row1.NOM to: row1.NOM == null ? "" : row1.NOM
2 REPLIES
Ten Stars

Re: tmap update with null value and not equals function

You'll have to test for null values before comparing the two values to each other (ex: row1.NOM != null) or else replace null values with empty strings. You can replace nulls using a tMap by changing the output expression for a column from row1.NOM to: row1.NOM == null ? "" : row1.NOM
Six Stars

Re: tmap update with null value and not equals function

 Thank you cterenzi it works !!! 

I put "row1.NOM == null ? "" : row1.NOM" in a variable tmap.

Capture.PNG