use Sybase::DBlib; my $dbh = new Sybase::DBlib( , , ); #A reference to my own error handler for sybase errors dberrhandle( \&myerrorhandler ); # if status flag is 1 then transaction was successful else the transaction was not successful $status = 1; sub myerrorhandler { < when error occurs the status flag $status is set to 0 > $status &=0; &INT_CANCEL; # in order to continue with the rest of the process } $dbh->nsql( "begin transaction" ); $dbh->nsql( ); . . . $dbh->nsql( ); if ( $status ) { $dbh->nsql( "commit" ); } else { $dbh->nsql( "rollback" ); }