Tim Bunce wrote:
On Fri, Sep 30, 2005 at 09:25:31AM -0700, Jeff Zucker wrote:
Tim Bunce wrote:
Did you remove this line on purpose?
$b = q{NULL} unless defined $b;
Yeap. quote() on an undef returns NULL
How polite of it! Thanks.
And as long as I'm asking - is there a better way to do this all
I'm not sure enough about what you're trying to do.
A number of people have commented to me that, when there are execute()
errors from wrong number, type, etc. of bind values, they want to be
able to cut and paste the SQL with the values into their command line
program for their DBMS to experiment. Some DBDs provide this with trace,
but most, AFAIK, don't (for the good reason that they never interpolate
the placeholders into the SQL at all). Having trace output that shows
the SQL with placeholders and the bind values displayed separately is
useful for spotting errors, but this would go a bit further and supply
the cut-and-pasteable version for those that have a use for it. This can
also be useful for people operating under Class::DBI or other situations
where finding out which values caused execute() errors can be a bit of a
chore.
--
Jeff