On a brighter note, I just ordered your 3rd edition of "MySQL." You are an
excellent author.
~mark
>>> Paul DuBois <[EMAIL PROTECTED]> 11-May-06 11:11:44 AM >>>
On 5/11/06 10:06, "Mark Galbreath" <[EMAIL PROTECTED]> wrote:
> Oh SHIT! I had the text files in the wrong directory. It works no
On 5/11/06 10:06, "Mark Galbreath" <[EMAIL PROTECTED]> wrote:
> Oh SHIT! I had the text files in the wrong directory. It works now. I am so
> DUMB!
Ah, well. Join the club. :-)
>
> Thank you all for all the suggestions and time you spent on my non-problem. I
> wish the error message woul
Oh SHIT! I had the text files in the wrong directory. It works now. I am so
DUMB!
Thank you all for all the suggestions and time you spent on my non-problem. I
wish the error message would have been a little more instructive, however.
mark
>>> Paul DuBois <[EMAIL PROTECTED]> 11-May-06 11
Huh. And you say this worked before? I don't see how it could.
$table is an identifier and shouldn't be surrounded by single quotes. That
particular name doesn't need any quoting, but if it did, the quote character
should be backtick (`), not apostrophe (').
Also, you might need to say \\n rathe
Actually, $table is not enclosed in quotes. And Paul corrected the quote
syntax in the second edition (I was using the first until just now). :-)
>>> "Mark Galbreath" <[EMAIL PROTECTED]> 11-May-06 10:30:38 AM >>>
There is no error in the log file. The actual terminal print is:
%> import_dbf
Not here :-(
As a seque, Paul's MySQL book has the file and delimiter in double quotes
~m
>>> "Martin J. Evans" <[EMAIL PROTECTED]> 11-May-06 10:15:26 AM >>>
use DBI;
my $dbh = DBI->connect('dbi:mysql:test','xxx','yyy');
$dbh->do(q/load data infile 'data.txt' into table fred fields termin
There is no error in the log file. The actual terminal print is:
%> import_dbf.pl: DBD::mysql::db do failed: You have an error in your SQL
syntax; check the manual that corresponds to your MySQL version for the right
syntax to use near 'MRJE001' FIELDS TERMINATED BY '|' LINES TERMINATED BY '
Sorry - of course, you are right.
Red Hat Linux Workstation 4.0 on Intel Pentium 4
Perl 5.8.5
DBI 1.50 (Dec 2005)
DBD::mysql 3.0003
Previous version DBD::mysql 2.9008 (Jun 2005)
>>> Paul DuBois <[EMAIL PROTECTED]> 11-May-06 10:22:10 AM >>>
Ah. I believe this is the first time you've mentioned
Ah. I believe this is the first time you've mentioned that it might have
something to do with the version of DBD::mysql. What's the last version you
used for which it worked, and the version that you're using now? That's
pertinent information; omitting it makes it more difficult for people to
help
use DBI;
my $dbh = DBI->connect('dbi:mysql:test','xxx','yyy');
$dbh->do(q/load data infile 'data.txt' into table fred fields terminated by
'|'/);
works for me with mysql client 5.0.15 and dbd::mysql 3.003_1.
You do of course need special privileges to use load data.
What exactly are you using pe
Check the server's query log to see what statement actually is arriving on
the server side.
Also, you say you get a malformed SQL syntax error. What's the exact
message you get?
On 5/11/06 8:02, "Mark Galbreath" <[EMAIL PROTECTED]> wrote:
> Tim,
>
> I've tried every imaginable option: single
Tim,
I've tried every imaginable option: single quotes, double quotes, escaped
quotes, table name only, no quotesnothing works. I think there is a bug in
DBD::mysql(3). I have spent hours and hours googling this problem and no one
else has reported it.
~mark
>>> Tim Bunce <[EMAIL PROT
On Wed, May 10, 2006 at 09:26:52AM -0400, Mark Galbreath wrote:
> Of course it's a string. It was a typo.
>
> my $rows = $dbh->do("LOAD DATA INFILE 'data.txt' INTO TABLE 'db.table' FIELDS
> TERMINATED BY '|'");
>
> 'db.table' == "database_name.table_name"
Don't put single quotes around the ta
Of course it's a string. It was a typo.
my $rows = $dbh->do("LOAD DATA INFILE 'data.txt' INTO TABLE 'db.table' FIELDS
TERMINATED BY '|'");
'db.table' == "database_name.table_name"
>>> Paul DuBois <[EMAIL PROTECTED]> 10-May-06 09:13:47 AM >>>
On 5/10/06 7:58, "Mark Galbreath" <[EMAIL PROTECTED
On 5/10/06 7:58, "Mark Galbreath" <[EMAIL PROTECTED]> wrote:
> Hi guys,
>
> The following query works fine from the MySQL client:
>
> LOAD DATA INFILE 'data.txt' INTO TABLE 'db.table' FIELDS TERMINATED BY '|'
>
> but fails in perl with a malformed SQL syntax error:
>
> my $rows = $dbh-
Hi guys,
The following query works fine from the MySQL client:
LOAD DATA INFILE 'data.txt' INTO TABLE 'db.table' FIELDS TERMINATED BY '|'
but fails in perl with a malformed SQL syntax error:
my $rows = $dbh->do(LOAD DATA INFILE 'data.txt' INTO TABLE 'db.table' FIELDS
TERMINATED BY '|')
16 matches
Mail list logo