hi,
this is a code snippet from a bigger source.
But it will show you how might handle errors.
# ...
# --------------------
# create db connection
# --------------------
$dbase = DBI->connect("DBI:Oracle:$dbsid", $dbuser, $dbpassw, { Auto
+Commit => 0 });
if (!(defined($dbase))){
# do error handling
}
#
# ----------
# do the sql
# ----------
# ...
$dbase->{PrintError} = 0;
$dbsth = $dbase->prepare( $sql );
$error = $dbase->errstr;
if (defined ($error) && $error ne "") {
# error handling
# errormsg is stored in $error
# ...
$dbase->{set_err}=(0, "");
$dbase->{PrintError} = 1;
# exit function or so
# ...
} else {
# no error
$dbase->{set_err}=(0, "");
$dbase->{PrintError} = 1;
# ...
}
# ...
I hope this can help you.