posted October 13, 1999 01:25 PM
Greetings,I've been ghosting this board for awhile and
have decided there are a few bulbs here
brighter than my own, so I submit the
following quandry in hopes of finding some
illumination.
I'm developing some on-line mySQL managment tools. Most everything seems to work ok, except for the the "file data [local] infile" function.
Here's the input $sql and the output from $DBH->errmesg: (path names changed to protect the innocent. Lines are indented, non-indented lines are virtual wraps. Line
temination char is '\n')
#...input
$sql = "LOAD DATA LOCAL INFILE '$in_file' $slam_type INTO TABLE $tabl FIELDS TERMINATED BY '$split_type' LINES TERMINATED BY '$end_type'";
$sth = $dbh->query($sql) | | $error_message = $dbh->errmsg;
if ($error_message !eq "")(
print "Unable to add data to $tbl<br>";
print "Load Error Message: <br>$error_message<br>\n";
}
#...end input
#...output
Unable to add data to PswdHash.
Load Error Message:
parse error near 'LOCAL INFILE '/root/web/client/local_dir/data_file.txt'
IGNORE INTO TABLE PswdHash FIELDS TERMINATED BY '|' LINES TERMINATED BY ' '' at line 1
#...end output
The data file exists and is readable by all. I tried running $sql through $DBH->quote() first, but no difference. I've tried it with
varying tables and data files, and with every quote/escape sequence I can think of. The tables import the data without a problem when
I load the data line by line using INSERT.
Any and all suggestions welcome...Thanks.
------------------
Tom
thomas@3dvr.net