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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI debugging: SQL dumping?
by moritz (Cardinal) on Mar 07, 2008 at 13:33 UTC | |
|
Re: DBI debugging: SQL dumping?
by Fletch (Bishop) on Mar 07, 2008 at 13:33 UTC | |
|
Re: DBI debugging: SQL dumping?
by clinton (Priest) on Mar 07, 2008 at 13:36 UTC | |
|
Re: DBI debugging: SQL dumping?
by perrin (Chancellor) on Mar 07, 2008 at 15:27 UTC | |
|
Re: DBI debugging: SQL dumping?
by dgaramond2 (Monk) on Mar 08, 2008 at 00:30 UTC |