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: "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
+++++++++  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

Loading DB routines from version 1.01
Emacs support available.

Enter h or `h h' for help.

main::(    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.
2083:     "Debugged program terminated.  Use `q' to quit or `R' to

I'm a big fan of debug mode.  Is there a way to get it to work in this

Thanks again,

Michael Peppler  on 10/30/98 05:19:49 PM

Please respond to
 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
+++++++++  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 Peppler         -||-  Data Migrations Inc.       -||-
Int. Sybase User Group  -||-
Sybase on Linux mailing list: