Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
DBI debugging: SQL dumping?by dgaramond2 (Monk) |
on Mar 07, 2008 at 13:29 UTC ( [id://672767]=perlquestion: print w/replies, xml ) | Need Help?? |
dgaramond2 has asked for the wisdom of the Perl Monks concerning the following question: Dear Monks, I have lots of complex SQL in my script in the form: $dbh->do("INSERT ... etc ... (FOO(?), ?, ?, ?, ?, ...)", {}, $var1, ...);(yeah I know, I should use CDBI or Rose::DB or whatever. But this is actually some low-level data importing stuffs which require SQL tweaking.) Sometimes when things do not go right, $dbh->do() failed with error from MySQL along the line of "syntax error near ) line 45". Since the SQL is pretty long/complex, is there a way to make DBI print the substituted/final SQL sent to the DB so I can better see which part is causing the syntax error?
Back to
Seekers of Perl Wisdom
|
|