simkeechai
Mar 29th 2006, 5:49 pm
hi there,
i am having problem loading data into my table.
here's my table 'mailing_list':
id int auto_increment primary key
email varchar(50)
email_source varchar(150)
country_id int(3)
sample data (seperated by tab):
xxx1@hotmail.com www.domain1.com 1
xxx2@gmail.com www.domain2.com 1
xxx3@blah.com www.domain3.com 1
xxx4@dude.com www.domain4.com 1
xxx5@kkk.com www.domain4.com 1
i would like to know the correct syntax to load this kind of data into mailing_list, fields email, email_source, and country only; and when i load these data, the id will increase automatically.
i tried to use the following syntax in query browser, but i got an error saying that there's error near line three:-
load data infile 'file location'
into table mailing_list
fields terminated by ''
lines terminated by '';
in addition, what if the data file is csv file, how do i load data into the table?
i appreciate your help. thank you in advance!
i am having problem loading data into my table.
here's my table 'mailing_list':
id int auto_increment primary key
email varchar(50)
email_source varchar(150)
country_id int(3)
sample data (seperated by tab):
xxx1@hotmail.com www.domain1.com 1
xxx2@gmail.com www.domain2.com 1
xxx3@blah.com www.domain3.com 1
xxx4@dude.com www.domain4.com 1
xxx5@kkk.com www.domain4.com 1
i would like to know the correct syntax to load this kind of data into mailing_list, fields email, email_source, and country only; and when i load these data, the id will increase automatically.
i tried to use the following syntax in query browser, but i got an error saying that there's error near line three:-
load data infile 'file location'
into table mailing_list
fields terminated by ''
lines terminated by '';
in addition, what if the data file is csv file, how do i load data into the table?
i appreciate your help. thank you in advance!