I ran into a serious obstacle today using Perl, DBI and DBD::Oracle and PL/SQL.
I have a PL/SQL package where I raise an exception:raise_application_error(-20002, 'No email address exists');
I then want to handle the exception in Perl - and ignoring it, considering the exception of type -20002 only a warning.
$sth2->execute();
$dbh->{HandleError} = sub {
print STDERR $sth2->errstr ."\n" if $verbose;
$dbh->set_err(0,"") if $_[1]->err == 20002;
return;
};
if (($dbh->err) and ($dbh->err != 20002)) {
print STDERR "Could not provision profile for: $row[0]/$row[1]\n";
print STDERR $sth2->errstr ."\n" if $verbose;
$dbh->rollback();
} else {
print STDERR "Provisioning profile for: $row[0]/$row[1]\n";
$dbh->commit();
}
But apparently this is not possible - the transaction seemed to become invalidated...
Most irritating I cannot decide how to handle the exception myself :-/