DBI question: binding params in HAVING clauses
Jeff Anderson
captvanhalen at gmail.com
Thu Jan 26 15:34:39 GMT 2006
Well, you are obviously no bureaucrat. :P
On 1/26/06, Andy Armstrong <andy at hexten.net> wrote:
>
> On 26 Jan 2006, at 15:01, Jeff Anderson wrote:
> > Like so?
> >
> > my $sql = sprintf('
> > SELECT COUNT(actors.name), countries.name
> > FROM actorsXcountries, countries, actors
> > WHERE actors.id = actorsXcountries.actorid AND
> > countries.id = actorsXcountries.countryid
> > GROUP BY countries.name
> > HAVING COUNT(actors.name) < %d
> > ORDER BY COUNT(actors.name)
> > ', $dbh->quote(3));
>
> What's the point of $dbh->quote() when %d can only expand to an
> integer anyway? Or rather what's the point of using sprintf()?
>
> --
> Andy Armstrong, hexten.net
>
>
--
jeffa
More information about the london.pm
mailing list