Prepared statements- variable number of placeholders

Tim Bowden <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <1350890207.2446.39.camel@mordor>
Is it possible, and if so, how can I set the number of placeholders in a
prepared statement at runtime?

IE, given something like:

my $sth = $dbh->prepare("INSERT INTO $table ($fields) VALUES (?,?,?));

which is fine if I know how many fields I'm inserting into, but what if
I don't know till runtime how many fields?  How can I put the (?,?,?)
into a variable and have it recognised as placeholders?

Thanks,
Tim Bowden
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.