Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: DBI question with placeholders and IN

by dws (Chancellor)
on Sep 30, 2002 at 22:15 UTC ( [id://201873]=note: print w/replies, xml ) Need Help??


in reply to DBI question with placeholders and IN

You need as many bind variables as you have values. Try the following (untested):
my $bindvars = join(",", ("?") x scalar @values); my $sql = <<END_SQL; SELECT COUNT(*) FROM some_table WHERE some_column IN ($bindvars) END_SQL my $sth = $dbh->prepare_cached($sql) || die; $sth->execute(@values) || die; ...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://201873]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-26 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found