Hello,
        Are you sure you need the \G in the statement? I think the following
would work:
        my $query = "SELECT * FROM MESSAGES WHERE pkey = $pkey";

J-T MacNeil
Design Team Member, Connect 24 Division
Digital Security Controls
Phone: (905) 760-3000 x7302
e-Mail: [EMAIL PROTECTED]


> -----Original Message-----
> From: Gregg Allen [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 02, 2003 3:51 PM
> To: [EMAIL PROTECTED]
> Subject: Perl DBI & MySQL
> Importance: Low
> 
> 
> 
> Can someone tell me why this statement works interactively 
> but not from 
> a perl script?
> 
> 
> MySQL>   SELECT * FROM MESSAGES WHERE pkey = $pkey\G ;
> 
> This prints the output in a very nice, readable format.
> 
> but:
> 
> my $query = " SELECT * FROM MESSAGES WHERE pkey = $pkey\\G ";
> 
> $sth->prepare($query);
> 
> $sth->execute();
> 
> This chokes on the prepare and execute statements.  (It says 
> the \G is 
> invalid syntax.)  All I want is a simple little script that
> will put an arbitrary database record into a file, after I 
> feed it the 
> primary key,  but will output the record's file in a format
> that's readable and printable.
> 
> Thanks in advance,
> 
> Gregg Allen
> 

Reply via email to