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: "Kurt A dot Seiffert" <seiffert at INDIANA dot EDU>
Subject: Re: Thoughts on handling sybase errors
Date: Sep 15 1998 8:30PM

I used a similar approach. However, I created a stack in that I just
push a reference to a list into my global, @SQLErrors.

I then just test it with something like:

	ProcessSQLError unless @SQLErrors == 0;

I'm toying with modifying the CTlib.pm so that my error stack is
available from my connection object, i.e. @{$dc->{SQLError}} (I may have
my braces in the wrong position. Been up all night.)

sub srv_cb
{
    my($dbh, $number, $severity, $state, $line, $server, $proc, $msg)
	= @_;

    my @parms
	= @_[1...7];

    # Don't track informational or status messages
    if ($severity >10) {
	print STDERR "Found error $msg\n";
	push @SQLErrors, (\@parms);
	}
    }

    CS_SUCCEED;
}
    
sub ProcessSQLError {
    my($number, $severity, $state, $line, $server, $proc, $msg)
	= @{pop @SQLErrors};

    if ($severity > 10) {
	print STDERR "Message number: $number  Line: $line\n";
	print STDERR "Msg String: $msg\n";
    }
}

-KAS

-- 
Kurt A. Seiffert                                   Indiana University
Decision Support Integration Analyst               Bloomington, IN 47408
University Information Technology Services         (812) 855-5089
"A mind is not a vessel to be filled, but a lamp to be lit."