Hello,
I've been trying to load about 400,000 entries into mysql using LOAD DATA INFILE. I import it from a csv file, however when I try to specify the order of loading fields I always get a syntax error.
This is the code that works:
LOAD DATA CONCURRENT INFILE '/home/virtual/path/var/www/html/FILE' REPLACE
INTO TABLE tbl_name FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n';
However when I type:
LOAD DATA CONCURRENT INFILE '/home/virtual/path/var/www/html/FILE' REPLACE
INTO TABLE tbl_name (col1,col2,col3,col4) FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n';
I always get an error syntax.
Does anyone have a solution? I've searched the web for loading values from a csv file while specifying values load order and I couldn't find anything.
Thanks a lot for your help,
Narcís