Subject: | Error reports line number in DBI.pm, not calling script |
Take the following code
$dbh->do( qq{ DELETE FROM TABLE WHERE FIELD=? }, { }, 0 )
and change to something like
$dbh->do( qq{ DELETE FROM TABLE }, { }, 0 )
(in other words, programmer was sloppy and forgot to remove bind
arguments),
DBI returns an error like:
execute called with 1 bind variables when 0 are needed at
C:/Perl/site/lib/DBI.pm line 1146.
In a script with dozens of similar SQL statements, it makes it hard to locate which if the offending one.