Up Prev Next
From: rhall at CORPNY dot FBC dot COM (Roger Hall)
Date: Aug 25 1999 8:00PM
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