DBI question: binding params in HAVING clauses
Andy Armstrong
andy at hexten.net
Fri Jan 27 14:25:38 GMT 2006
On 27 Jan 2006, at 13:58, David Cantrell wrote:
> Indeed. However, because of how I'm building my queries, I don't know
> in advance which params are going to be strings and which are
> ints. So
> now I'm having to do ...
>
> $val = $dbh->quote($val) if($val !~/^-?\d+(\.\d+)?$/);
>
> and things are beginning to look really messy. Not to mention that I
> got the regex wrong twice. Which gets me back to wanting
> placeholders.
Why can't you just wrap the quoting up in a subroutine? It shouldn't
be duplicated surely?
--
Andy Armstrong, hexten.net
More information about the london.pm
mailing list