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: David C Worenklein <dcw at gcm dot com>
Subject: dbmsghandle's $db - what is it?
Date: Oct 30 1997 8:11PM

If you call a method and it causes the message handler to be invoked,
the database handle passed to the message handler is NOT the same
one that called the method.


Example:
========
use strict;
use Sybase::DBlib;

sub msghandle {
    my ($db, $message, $state, $severity, $text, $server, $procedure, $line) = @_;

	print "A: $db\n";
}


dbmsghandle(\&msghandle);

my $DB = new Sybase::DBlib $ENV{DB_DFLT_USR},$ENV{DB_DFLT_PWD},$ENV{DSQUERY};
print "B: $DB\n";
$DB->dbuse("inv");

output:
=======
A: HASH(0xc5450)
A: HASH(0xc5450)
B: Sybase::DBlib=HASH(0x18288c)
A: HASH(0x189fc8)