Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I need to update fields in my database if the value is not null.
In
TargetI have already these values :
{Id : 3, Name : GUEST, First_name: Hope, Age:3}In Input : I have
{Id : 3, Name : GUEST,
First_name: "",
Age:6}
Normally after the update I should have {Id : 3, Name : GUEST,
First_name: Hope , Age:6} but I have : {Id : 3, Name : GUEST,
First_name: "", Age:6}
The first name was updated by a null value.
Note that the first name field can be nulled. If I check Nullable in tmap and
If I have in target {Id : 3, Name : GUEST,
First_name: "", Age:3}
and INPUT ; {Id : 3, Name : GUEST,
First_name: "", Age:6} I will have
nullpointer error.How to do?
Thanks
Hi
The result is normal output, all fields will be updated if the key exists, there is no option that we can configure the filed to be not updated if it is null. The workaround for this issue is doing an inner join with target data base on key column id, eg:
input--main(row1)--tMap--out1--target
|lookup(row2)
target
set the expression of name column in the output table of tMap like:
row1.name==null?row2.name:row1.name
The field will use target's value if the source value is null.
Regards
Shong