Re: Stupid Oracle question

[email protected] (Bruce Johnson)
Newsgroups perl.dbi.users
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.