- or download this
select name,value from A where name in ('a','b','c','d','e')
- or download this
# Make a quoted list of strings
my @quoted_vals = map { "'$_'" } @var1;
my $sth3 = $dbh->prepare("select name,value from A.database1 where nam
+e in ("
. join(",",@quoted_vals) . ")"
) or die "Can't prepare statement: $DBI::errstr";
- or download this
select name,value from A where name in (?, ?, ?, ?, ?)
- or download this
# Build SQL statement with question marks instead of values
my $sth3 = $dbh->prepare("select name,value from A.database1 where nam
+e in ("
...
# Tell DBI to replace the question marks with the list of values
$sth3->execute(@var1);