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: arthur at puma dot mt dot att dot com
Subject: DBD::Sybase message handling question
Date: Jul 10 2001 4:21PM

How do I prevent the "error" messages from being sent to stderr if I have
an error handler?  In the example below, each message is printed twice, i.e.
"Lock scheme Allpages".

Thanks,
Arthur


@ more tj.pl

#!/bin/perl

use DBI;

$dbh=DBI->connect('dbi:Sybase:MTFRAMEDV','db','pw');

sub jj{
 my($err, $sev, $state, $line, $server, $proc, $msg) = @_;
print "err is $err and sev is $sev and state is $state and line is $line\n";
print "server is $server the proc $proc and message: $msg\n";
  print "called\n";
};

$sth = $dbh->prepare('sp_help cp_user');
$dbh->{syb_err_handler}=\&jj;

$sth->execute;

do {
while($d=$sth->fetch) {
 $out_put .= "@$d==\n";
}
}while ($sth->{syb_more_results});

@ perl tj.pl

err is 0 and sev is 10 and state is 1 and line is 84
server is MTFRAMEDV the proc sp_helpartition and message: Object is not partitioned.
called
Object is not partitioned.
err is 0 and sev is 10 and state is 1 and line is 642
server is MTFRAMEDV the proc sp_help and message: Lock scheme Allpages
called
Lock scheme Allpages
err is 0 and sev is 10 and state is 1 and line is 647
server is MTFRAMEDV the proc sp_help and message: The attribute 'exp_row_size' is not applicable to tables with allpages lock scheme.
called
The attribute 'exp_row_size' is not applicable to tables with allpages lock scheme.
err is 0 and sev is 10 and state is 1 and line is 652
server is MTFRAMEDV the proc sp_help and message: The attribute 'concurrency_opt_threshold' is not applicable to tables with allpages lock scheme.
called
The attribute 'concurrency_opt_threshold' is not applicable to tables with allpages lock scheme.err is 0 and sev is 10 and state is 1 and line is 669
server is MTFRAMEDV the proc sp_help and message:  
called