Four Stars

Writing null values into database instead of empty strings

Hi,

 

I try inserting data from a csv file into a postgres database. In the csv file several cells are empty. In my schema the columns are all nullable.

Nevertheless, talend writes empty strings '' into the database instead of null values.

Do you have any idea how I can insert null values?

 

Thanks

Hein

 

Schema.JPG

 

Screenshot.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Five Stars

Re: Writing null values into database instead of empty strings

Hi,

Please try adding one more component tmap in between both the connectors and for that column alone check for empty string if so then set null, something like
Row1. Field==''? null:row1.field.

Let me know if above works.
Thanks,
Ram
4 REPLIES
Five Stars

Re: Writing null values into database instead of empty strings

Hi,

Please try adding one more component tmap in between both the connectors and for that column alone check for empty string if so then set null, something like
Row1. Field==''? null:row1.field.

Let me know if above works.
Thanks,
Ram
Ten Stars

Re: Writing null values into database instead of empty strings

Don't use == to compare Strings. Use .equals() or in this case .isempty() instead.
Four Stars

Re: Writing null values into database instead of empty strings

Thank you for your quick answers.

I had hoped there was a checkbox or something I missed.

 

But your solution will definitely work.

Five Stars

Re:how to replace null value by '.'

hello ,

i have one column for monile number and some user not inserted value in that column ..

 

so i wand to replace that value by dot '.'

 

 

 

Thank you