tmap update with null value and not equals function

Highlighted
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

 

 

 

 


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

All 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

 

 

 

 

 

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now