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