in reply to How to see executed SQL string?

Assuming you are using the DBI module, you can use "trace" to see the query that is actually being sent to the database. Do
perldoc DBI
at a command prompt to read the excellent documentation that is included with the DBI module. Search(using the forward slash "/") for the word "trace".

The basic idea is to turn trace on before the statements you are interested in, and turn it off after - something like this:
$sql="Select * from table where column=?"; DBI->trace(2); # turn trace on $rh=$dbh->prepare($sql); $rh->execute($str); DBI->trace(0); # turn trace off
HTH.

Replies are listed 'Best First'.
Re: Re: How to see executed SQL string?
by Itatsumaki (Friar) on Jun 04, 2003 at 16:57 UTC
    You might want to direct trace to a file: I find that easier usually. Also be aware that trace has 9 levels, and you can get more detail going up a level. The specific bind variables would come out with a trace(2) as hmerrill noted.
    DBI->trace(2, "tracefile.txt");