use DBI; use DBD::Oracle; # Define sid, user, password, etc. here my $dbh = DBI->connect($DB_SID, $DB_USER, $DB_PASSWORD, 'Oracle') or die( $dbh->errstr ); my $name = "guppy"; my $sql_statement = 'SELECT foo FROM table_bar WHERE name = ?'; $sth = $dbh->prepare( $sql_statement ) or die( $dbh->errstr ); # This is where I try to replace the placeholder with $name $sth->execute( $name ) or die ( $dbh->errstr ); while( $aref = $sth->fetchrow_arrayref ) { print $aref->[0] ."\n"; } $sth->finish; $dbh->commit; $dbh->disconnect;