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: "Johnson, Phil" <Phil dot Johnson at fmr dot com>
Subject: Thoughts on handling sybase errors
Date: Sep 15 1998 3:42PM

I'm writing some sybperl scripts that take a list of Sybase NetGateways or
SQL Servers as their arguments and will perform operations over this list of
databases.

Sometimes, either due to typos or whatever, a database might not be listed
in the interfaces file or a user's id and password might not be synchronized
on one or more databases.  I would like to perform my operations on the
databases I can connect to and save the list of unconnectable databases and
report them at the end of the run.  I think I have solved the problem, but
would like some reassurance that my approach is faulty nor
counterproductive.

My solution was to copy the 'sybutil.pl' to "modified_sybutil.pl", put
"global" variables "$sybase_error" and "$sybase_error_msg" at the top of the
modified module and set these variables to the values of "$error" and
"$error_msg" respectively in the error_handler subroutine.  I can now access
these values from within my main program and regurgitate the list of
unconnectable databases with the errors to the user.

Is this the "correct" way of handling such a problem?  Does anyone see
anything inappropriate in this logic?