http://www.perlmonks.org?node_id=201863

dragonchild has asked for the wisdom of the Perl Monks concerning the following question:

I'm using DBI with Oracle (don't know which version) and Perl 5.004 (not my decision) for some rather complex queries and I've found that I want to be able to do the following:
my $values = join ",", @values; # This is 1 to N values my $sql = <<END_SQL; SELECT COUNT(*) FROM some_table WHERE some_column IN (?) END_SQL my $sth = $dbh->prepare_cached($sql) || die; $sth->execute($values) || die; while ($sth->fetch) { # Do stuff } $sth->finish || die;
But, I cannot. The only solution I've found is to put $values directly into the prepare, which negates the prepare_cached() benefits. Does anyone have a better way?

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.