Up Prev Next
From: collardp at rabo-bank dot com
Subject: RE: Transactions
Date: Aug 26 1999 7:15AM
Permission errors terminate the transaction. I think the logic is that they
are coding errors rather than data errors.
Peter Collard (x3863)
Senior Sybase DBA
The views expressed in this correspondence are those of the author and
do not necessarily represent those of Rabobank International
I was wondering if anyone could explain the following, or point me at
an example or document that explains what I'm doing wrong. The following
code runs fine. I run it as a normal user and so the select gives me
a couple of permission denied errors and then my error saying 'OUCH'.
If I un-comment the two transaction lines, I still get the two permission
errors, but my 'OUCH' error no longer gets output.
my($srv) = 'SERVER';
my($dbn) = 'DATABASE';
my($uid) = 'USER';
my($pwd) = 'PASSWORD';
my $dbh = Syb->new($srv, $uid, $pwd, $dbn)
|| die "\nFailed to create a database handle for '$srv.$dbn'.\nStopped";
($sql = <<"SQL") =~ s/^\s+@@@ ?//gm;
@@@ -- begin transaction
@@@ select * from master..syslogins
@@@ if \@\@error != 0
@@@ raiserror 30000, 'OUCH'
@@@ -- commit