PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Narasayya Immid <narasan at yahoo dot com>
Subject: SybPerl-DBlib question..
Date: Jan 27 1999 5:27AM


I am using SybPerl-DBlib. I was trying to update a table in a
transaction. If the update is failed thru' underlying trigger, how can
I capture the error code and message raised by the trigger? How do I
stop the program flow?
Any help is greatly appreciated.

- Thanks in advance.
-----------------------------------------------------

   
$dbh= Sybase::DBlib->dblogin("user","pwd","SYBSERVER");
 $dbh->dbuse("dbname");
 $dbh->dbcmd("begin tran \n
              update ...
              set ...
              where ....
 
              if(\@\@rowcount != 1)
              begin
                 rollback transaction
              end \n

              Another update...

              if(\@\@rowcount != 1)
              begin
                 rollback transaction
              end \n

              commit tran \n

              ");
   $dbh->dbsqlexec;
   while($dbh->dbresults !=NO_MORE_RESULTS)
   {   
       while(%dbdata=$dbh->dbnextrow(1))
       {          
       }
   }
   $dbh->dbclose();








_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com