On May 6, 2010, at 11:34 AM, John Scoles wrote:

Bruce Johnson wrote:

Depends if you have |AutoCommit| on or not and if you DB and DBD friver can do a rollback.


I've explicitly turned autocommit off, so I can roll back transactions if an error occurs.

In the old Oraperl syntax it's:

if ($ora_errstr){
        print "$ora_errstr occurred with $statement";
        &ora_rollback($dbh);
        }
&ora_commit($dbh);

I'm redoing some old scripts to use DBI instead, so I'm guessing the equivalent DBI code is:

if ($ora_errstr){
        print "$ora_errstr occurred with $statement";
        $dbh->rollback();
        }
$dbh->commit();

--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group

Institutions do not have opinions, merely customs


Reply via email to