delete $dbh->{RaiseError}; #### # at this point RaiseError is off as per default connection { local $dbh->{RaiseError} = 1; LABEL_START_TRANSACTION1: eval { # prepare the sql statement $sth = $dbh->prepare($sql); # execute the sql statement $sth->execute(); }; } if ($@) { .. handle the error }