in reply to Unable to load entire CSV file into DB
With minimal changes, I think that your LOAD DATA statement should read,
That takes care of quoting problems. Is your record seperator really "\r"? That seems odd.my $stmt = qq(LOAD DATA LOCAL INFILE '../$cvstoupload' INTO TABLE statezones FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r' IGNORE 1 LINES);
I think that the relative path will be taken by mysqld to be relative to the directory of the database you're logged into. Use absolute paths.
I'm not sure how this has worked at all. Regarding the data file, check with a hex dump or something that the record seperators are all consistent and are what you think they are.
This seems like an odd application to do as CGI. Are you cursed with no shell access to the host? If so, I'd change host - this is an insecure thing to have around.
After Compline,
Zaxo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Unable to load entire CSV file into DB
by shenme (Priest) on Nov 07, 2004 at 00:34 UTC |