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 table name.

        db.table
or      `db`.`table`

should work, but 'db.table' won't.

Tim.

> >>> Paul DuBois <[EMAIL PROTECTED]> 10-May-06 09:13:47 AM >>>
> 
> 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->do(LOAD DATA INFILE 'data.txt' INTO TABLE 'db.table' FIELDS
> > TERMINATED BY '|');
> >  
> > Anybody have a clue as to why this will not work?
> 
> That hasn't the faintest hope of working.  You should post the actual code
> that you're using.  do() with a non-string argument is surely not your
> actual code.
> 
> Also, 'db.table' doesn't look like a valid quoted identifier.
> 
> 
> 
> 

Reply via email to