February 2000
Intermediate to advanced
364 pages
11h 47m
English
err
$rv = $h->err;
Returns the native database engine error code from the last driver method called. The code is typically an integer, but you should not assume that.
The DBI resets
$h->err
to undef before most DBI method calls, so the
value has only a short lifespan. Also, most drivers share the same
error variables across all their handles, so calling a method on one
handle will typically reset the error on all the other handles that
are children of that driver.
If you need to test for individual errors and have your program be portable to different database engines, then you’ll need to determine what the corresponding error codes are for all those engines, and test for all of them.
Read now
Unlock full access