Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
kyawzin
Contributor II
Contributor II

Data type conversion in Talend Community Vesrsion

Dear team,

 

Now I've created one job to load data from CSV to MySql database. The data type from csv is not match to mysql table data type, so I need to change data type. Then I use tConvertType but I got null or error after running the job.

 

I work around with configuration in tConvertType and tMap but it doesn't work. For example there is phone number in csv with integer data type but i have to convert to string before loading to mysql database. could anyone please give me the sample job like this.

 

Thank you.

Labels (3)
3 Replies
Anonymous
Not applicable

For the telephone number you can simply set the column for the file import component (I assume you are using a tFileInputDelimited) to String.

 

With regard to the errors you were getting, could you post them? 

Anonymous
Not applicable

use this string.valueof(row1.phonenumber), or else in the csv while writing metadata, you can change to string instead of using integer, this both of the solutions will work

 

 

Anonymous
Not applicable

This will not work. If a telephone number such as 07555123456 is read as a number by the tFileInputDelimited, then the leading zero will be removed and you will end up with 7555123456. The telephone number must be read as a String from the beginning.