Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: DBD::Sybase, attribute syb_err_handler
Date: Jul 10 2002 2:25PM

On Tue, 2002-07-09 at 18:21, Matthew O. Persico wrote:
> Two questions:
> 1) When last I was using error handlers in Sybase, it was for DBLib or Sybase::DBLib and there were two, err_handler and msg_handler. Can I assume from the DBD::Sybase docs that there is one exposed handler now (syb_err_handler) and that it should be coded to handle the
> functions of both err and msg handler? , i.e I COULD do this:
> sub my_old_err_handler {
> ..
> }
> syb my_old_msg_handler {
> ..
> }
> syb my_new_handler {
> 	if ($state==0 && $line==0 && !defined($server) && not
> 		defined($proc)) {
> 		return my_old_msg_handler (@_);
> 	} else {
> 		return my_old_err_handler(@_);
> 	}
> }

Well - you could, but having $proc undefined doesn't necessarily mean
that it's a client side error.

> 2) If I decide to skip processing, what value should be returned? $err?

Return "false" from the error handler to have DBI ignore the error (i.e.
don't trigger RaiseError/PrintError processing in DBI).

Michael Peppler / / / ZetaTools, Inc /
ZetaTools: Call perl functions as Sybase stored procedures!