On Thu, Apr 04, 2002 at 08:21:27AM +0200, Sauer (ext_evosoft) Martin wrote:

> sub err_trap
> {
>    my $error_message = shift(@_);
>    $DbS->rollback;
>    die "$error_message\n  ERROR: $DBI::err ($DBI::errstr)\n";
> }

> 1) Why are $DBI::err and $DBI::errstr set to undef at that point of
> execution? Is this the wrong way to check for errors? Do I need to test them
> via the database handle ( $DbS->err ) ?

When you call rollback(), you reset the error from the previous statement.
You need to get the error message/code before you call rollback().

Ronald

Reply via email to