in reply to DBI and variable numbers of bind parameters
is to saymy $in; $in .= '?, ' for @ins; # discard hanging comma $in =~ s/, $//;
But actually I have a question on your first approach. Does it actually work? I've been trying it here, passing a string of comma separated numeric values as the bind value for a single placeholder in an IN clause, and in my case (MySQL 4.1, DBD::mysql 2.9007) it seems to just take the first value in the list. Can you post some more sample code and output to show how this works? I ask because it seems like it shouldn't work; that is, it shouldn't let you pass multiple values for a single placeholder.my $in = join ', ', ('?') x @ins;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBI and variable numbers of bind parameters
by friedo (Prior) on Oct 18, 2005 at 04:46 UTC |