How to replace a "NULL" to an empty string

Four Stars

How to replace a "NULL" to an empty string

Hi All,
I have an use case where we have data in sql server which stores the keyword NULL but my target which is Snowflakes doesn't accept NULL. Is there a component that I can use to convert the NULL to like an empty string. Any help is appreciated.
Moderator

Re: How to replace a "NULL" to an empty string

Hi,
You can use tMap or treplace component to achieve your goal.
In tMap, the expression should be:row1.input==NULL?"":row1.input
Let us know if it is Ok with you.
Best regards
Sabrina
 
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: How to replace a "NULL" to an empty string

Hi,
Yes that worked for me. Thanks
Moderator

Re: How to replace a "NULL" to an empty string

Hi,
Can we consider this topic as resolved? Feel free to let us know if there is any further help we can give.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Highlighted
Four Stars

Re: How to replace a "NULL" to an empty string

Hi Sabrina,

 

I am facing similar issue using Snowflake as the Database. row1.input==null? "": row1.input is throwing error as NULL cannot be inserted into Database.

 

Could you please suggest a solution for this.

 

Regards,

Saravanan.

What’s New for Talend Summer ’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

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch