Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error handling

  • Set the attributes PrintError and RaiseError
  • Check for returned undef (or empty lists)
  • Check $h->err and $h->errstr (aka. $DBI::err and $DBI::errstr)
  • err - Native DB engine error code
  • errstr - Native DB engine error string
$sth = $dbh->prepare($statement)   or die $dbh->errstr;
$rv  = $sth->execute(@bind_values) or die $sth->errstr;

fetchrow_array (and others) return undef when no more row or if they encounter an error. Use RaiseError or check $sth->err