in reply to Using multiple values in a SQL "in" statement
my @id=(1,2,3,4); my $question_mark_string = join(',', ('?') x scalar(@id) ); # ?,?,?,? my $sth = $dbh1->prepare("SELECT name FROM table where id in ( $questi +on_mark_string )") or die "Couldn't prepare statement: " . $dbh1->err +str; $sth->execute(@id)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Using multiple values in a SQL "in" statement
by jhourcle (Prior) on May 02, 2013 at 02:28 UTC | |
Re^2: Using multiple values in a SQL "in" statement
by perlvroom (Acolyte) on May 02, 2013 at 17:51 UTC | |
by jhourcle (Prior) on May 05, 2013 at 13:07 UTC |
In Section
Seekers of Perl Wisdom