Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

getting the sql executed from a parameterised statement

by Anonymous Monk
on Dec 01, 2010 at 22:14 UTC ( [id://874773]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Revered monks

If i use a parameterised query such as the one shown below, how do i get the actual sql that the db engine failed to execute?

my $update_meta_sql = "update runmeta set known_snps=? where run_id=?" +; unless ($db->do($update_meta_sql, undef, $updates, $run_id)) { $status = "failed at update runmeta"; }
many thanks

Replies are listed 'Best First'.
Re: getting the sql executed from a parameterised statement
by wallisds (Beadle) on Dec 01, 2010 at 23:06 UTC

    I think getting the sql is driver specific, but try adding $db->errstr:

    unless ($db->do($update_meta_sql, undef, $updates, $run_id)) { $status = "failed at update runmeta: ". $db->errstr; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://874773]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-24 20:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found