DBI question: binding params in HAVING clauses

David Cantrell david at cantrell.org.uk
Fri Jan 27 14:18:50 GMT 2006

On Thu, Jan 26, 2006 at 04:53:14PM +0000, Andy Armstrong wrote:

> I understand what's being attempted. I imagine either sprintf() or  
> $dbh->quote() would work correctly (certainly many SQL dialects don't  
> mind numbers being quoted - I don't know if that's true here) but it  
> certainly won't work with both.

Oracle doesn't mind numbers being quoted.  SQLite most definitely
doesn't like it, at least in HAVING clauses.

What I've not tried is comparing a text field to a literal number, and
*not* quoting the number.  My code may very well break in that case
(although I believe it unlikely to ever happen).  Oh frabjous day!

So here's a suggestion.  I - or rather, my lovely employers - will give
fifty quid in cash to whoever submits a patch for DBD::SQLite to get
placeholders working in HAVING clauses and has their code appear in a
new release of the DBD :-)

David Cantrell | random organic glop and a metric fuckton of electricity

    If you have received this email in error, please add some nutmeg
    and egg whites, whisk, and place in a warm oven for 40 minutes.

More information about the london.pm mailing list