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: "Scott D Urban" <Scott_Urban at freddiemac dot com>
Subject: DBlib error handling
Date: Oct 30 1998 7:42PM


I'm having trouble understanding the error handler in DBlib.  I am
expecting one of the handlers to get called in this (or any other) error
scenario.  Can someone tell me what I'm doing wrong?


use Sybase::DBlib;

&dbmsghandle ("message_handler");
&dberrhandle ("error_handler");

$dbh = Sybase::DBlib->dblogin($id, $pw, $server);
$dbh->dbcmd('select @@getdat'); # intentional typo to get error
$dbh->dbsqlexec;




sub message_handler
{
    print "+++++++++  in message_handler  +++++++++++++\n";
    0;
}

sub error_handler {
    print "+++++++++  in error_handler ++++++++++++++\n";
    INT_CANCEL;
}



Thanks,
Scott Urban