Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load Data into table with SET type columns?

Status
Not open for further replies.

Coderifous

Programmer
Dec 13, 2001
782
US
I have a tab delimited text file.
I have a mysql table all setup with columns described properly. SOME of the columns are of the type "SET".

Just for argument purposes, lets say the SET type columns have legal values "a","b","c","d"

When using:
load data local infile "/path/to/file" into table my_tbl;

Everthing goes in fine except for the SET type columns, they only get one of the described pieces. For instance:

if the values of the tab-delimited ( [tab] for tabs)records are like:

John Dragodirt[tab]1234 Sun Drive[tab]("a,b,d")[tab]22030
Susy Quirtenod[tab]2345 Moon Lane[tab]("b,d,a")[tab]22456

It populates the table with the two records, but the 3rd column only gets the last values... "d" and "a". How do I format the tab file so that the table will be populated properly, with the SET type columns having all legal values entered, not just the last one there?

I appreciate any help, thanks.

--Jim
 
Fuhgedaboudit.

I figured it out.

I was thinking toooooooo hard.

 
Hi

Could you please share your findings. I got the same problem. Thanks a lot.

Dagang
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top