Map ENUM field from CSV to MySQL

One Star

Map ENUM field from CSV to MySQL

Hi,
I have a CSV like this.
"Mobile","Home Phone","Email","Languages Spoken"
2564589658,4589653259,support@gmail.com,English;Spanish;Russian
The field "Languages Spoken" has a multi-enum drop-down list.
I am using basic tMap to import the data.
If I select type as List in CSV it does not work.
Can someone please help.
Thanx in advance.
John
Four Stars

Re: Map ENUM field from CSV to MySQL

Hi John,
After looking at your data, I found that columns are ","separated. And your enum data is ";" separated. If you execute with same configuration and read the metadata, automatically the column "Languages Spoken" would contain all the enum fields.
Keeping the datatype for "Languages Spoken" column to string would solve your purpose.
Thanks
Vaibhav
One Star

Re: Map ENUM field from CSV to MySQL

Hi Vaibhav,
Firstly thanx for the reply and my apologies; I've not mentioned the full scope of import.
Basically it's a CSV to SugarCRM import.
Therefore the (input) CSV fields are ';' separated (for "Languages Spoken"). However the output needs to be in another format - as below:
"Mobile","Home Phone","Email","Languages Spoken"
2564589658,4589653259,support@gmail.com,^English^,^Spanish^,^Russian^
So it's basically a conversion of the string that is needed. I'm presuming an additional filter step is required?
Thanx in advance.
John
Seventeen Stars

Re: Map ENUM field from CSV to MySQL

A MySQL ENUM field is a field which contains one string and in the metadata of the table are declared so called ENUMs - which means actually a fix list of possible values. A enum column does not hold more than one value at once!
Your use case, storing a list of languages the customer (?) speaks has nothing to do with enums. You should simply write the languages comma separated and thats it.
One Star

Re: Map ENUM field from CSV to MySQL

Hey Jan,
Thanx for the reply.
Actually it's a multi-enum field in SugarCRM.
I got the answer here.
http://www.talendforge.org/forum/viewtopic.php?id=33337
Thanx all for your help.
Regards,
John