Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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?
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
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.