# Assume 'RaiseError' is set, and 'AutoCommit' is off. eval { my $sth = $db -> prepare (<<" --") INSERT INTO $Table[$II] VALUES (?, ?, ?, ?); -- $sth -> execute ($ID, $Itemname, $Firstbid, $Endingprice); }; if ($@) { $dbh -> rollback; die $@; } else { $dbh -> commit; }