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


in reply to DBI Deletes with placeholders

Deletes with placeholders are possible with prepare/execute and do ways.

Like talexb said, you should get the error message from the driver, and with that you could get a better hint on what went wrong.

my $qry = "delete from my_table where id=?"; my $sth = $dbh->prepare($qry); $sth->execute($value_to_delete) or die DBI->errstr; print "deleted rows = ".$sth->rows; $sth->finish;

To do the same but using bind values with the do method you can

my $qry = "delete from my_table where id=?"; $dbh->do($qry, undef, $value_to_delete);
Also, id is an Oracle reserved word and you should avoid using it.