HI,
If I call the below sub with an sql statement containing placeholders and an array of values it treats @vars as a single bind variable.
can execute not be called with an array, is there anyway of calling execute without explicitly declaring x number of variables for each statement?
or has it just been so long since I did perl I forgot perlthink..
###call below sub
runsql("select * from table where 1=? and 2=?",$dbh,[$1,$2]);
sub runsql {
my $sql=shift;
my $dbh=shift;
my $vars=shift;
my $sth=$dbh->prepare_cached($sql);
$sth->execute(@$vars);
}
thanks