I am using Talend to prepare dataware.
I want to compare the string with the contents of a column using the tMap component and create a variable to store in the DB. The problem is that the ==
operator does not give the right result (Example: row2.recipient == "text"?"text":""
I always get ""
) and if I use .equals
I get errors when executing.
Asked
Active
Viewed 1.2k times
5

Special Sauce
- 5,338
- 2
- 27
- 31

Ahmed BEN MANSOUR
- 53
- 1
- 1
- 3
1 Answers
7
You will get error if row2.recipient is null, and "==" should not be used when comparing strings. Correct syntax would be :
"text".equals(row2.recipient)?"text":""
Then you will prevent NullPointerExceptions.

Corentin
- 2,442
- 1
- 17
- 28