in reply to Re: $dbh->quote(..., SQL_INTEGER)
in thread $dbh->quote(..., SQL_INTEGER)

Thanks for your answer!

What do you think about this idea: redefine $dbh->quote() by this logic:
  1. check perl internals (SV) to find is my param a number or string
  2. if it's a number - return something like yours quote_integer(), else return original $dbh->quote()
This way we will be able to control $dbh->quote() bevaviour this way:
$dbh->do("INSERT ... SELECT ... WHERE a=? LIMIT ?", undef, $a, 0+$limit);

Replies are listed 'Best First'.
Re^3: $dbh->quote(..., SQL_INTEGER)
by hv (Prior) on Sep 04, 2004 at 13:13 UTC

    Checking the internals of an SV is almost always the wrong thing to do.

    If you're happy to pass 0+$limit without checking for problems, you might as well interpolate that straight into the SQL rather than missing with quote().

    Hugo