tFileInputDelimited and null values

One Star

tFileInputDelimited and null values

Hi,
I use tFileInputDelimited to upload datas in MySQL. The structure is defined through Metadata - File delimited.
Is there a way to define that empty fields between 2 delimiters are null values rather than empty strings ?
This is better for nullable foreign keys.

Ex :
Id;NumValue1;StringValue1;NumValue2;StringValue2;DateValue
1;8;Some text;0;;20080505
StringValue2 is null and not "".

Thanks for your help
Community Manager

Re: tFileInputDelimited and null values

Hello
Before upload the datas in MYSQL, you can use a tMap component to convert some value, for example:
row1.StringValue2.equals("")?"null":row1.StringValue2

Feel free to post your questions!
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tFileInputDelimited and null values

Thanks, it works with this expression :
row1.StringValue2.equals("")?null:row1.StringValue2

(null without double quotes)