|
|
sybperl-l Archive
Up Prev Next
From: "Scott D Urban" <Scott_Urban at freddiemac dot com>
Subject: Re: DBlib error handling
Date: Nov 2 1998 4:20PM
Thanks for the responses.
I think I found the problem. I've been running my script in debug mode.
When I run it normally it is working properly.
> perl dbtest.pl
+++++++++ in message_handler +++++++++++++
Sybase::DBlib=HASH(0x18e2cc) 137 2 15 Must declare variable '@@getdat'.
hq103sr3 1
+++++++++ in error_handler ++++++++++++++
Sybase::DBlib=HASH(0x18e2cc) 5 20018 -1 General SQL Server error: Check
messages from the SQL Server.
> perl -d dbtest.pl
Loading DB routines from perl5db.pl version 1.01
Emacs support available.
Enter h or `h h' for help.
main::(dbtest.pl:6): my ($dbh);
DB<1> r
Msg 137, Level 15, State 2
Server 'hq103sr3', Line 1
Must declare variable '@@getdat'.
DB-Library error:
General SQL Server error: Check messages from the SQL Server.
DB::fake::(/usr/local/lib/perl5/perl5db.pl:2083):
2083: "Debugged program terminated. Use `q' to quit or `R' to
restart.";
I'm a big fan of debug mode. Is there a way to get it to work in this
mode?
Thanks again,
Scott
Michael Peppler on 10/30/98 05:19:49 PM
Please respond to SYBPERL-L@listproc.net
To: SybPerl Discussion List
cc: (bcc: Scott D Urban/ISS/HQ/FHLMC)
Subject: DBlib error handling
Scott D Urban writes:
>
>
> 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?
I don't know - your little script definitely triggers both the message
handler and the error handler here. I added a print "@_\n" in both
handlers, and here's what I get:
kiruna (2:18pm):3 > perl err2.pl
+++++++++ in message_handler +++++++++++++
5701 2 0 Changed database context to 'master'. 1
+++++++++ in message_handler +++++++++++++
5703 1 0 Changed language setting to 'us_english'. 1
+++++++++ in message_handler +++++++++++++
Sybase::DBlib=HASH(0x135ed8) 137 2 15 Must declare variable '@@getdat'. 1
+++++++++ in error_handler ++++++++++++++
Sybase::DBlib=HASH(0x135ed8) 5 20018 -1 General SQL Server error: Check
messages from the SQL Server.
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@mbay.net -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
|