my $sth3 = $dbh->prepare("select name,value from A where in (".join(",",@var1).")"); - @var1 contains the 5 values $sth3->execute(@var1); while (my @row = $sth3->fetchrow_array) { print join(", ", @row), "\n"; } #### DBD::Oracle::db prepare failed: ORA-00936: missing expression (DBD ERROR: error possibly near <*> indicator at char 58 in 'select name,value from A where <*>in (1,2,3,4,5)') [for Statement "select name,value from A where in (1,2,3,4,5)"] at hello.pl line 99. Can't call method "execute" on an undefined value at hello.pl line 102.