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: Rick Nicoletti <rickn at mpi dot com>
Subject: Re: dbsetopt in DBD::Sybase
Date: Jun 22 1999 2:01PM

Ah.  I think I found my problem. In a nutshell, I was using an
older DBI/DBD::Sybase.

Originally, when I did this:

$dbh = DBI->connect("dbi:Sybase:$server", $user, $passwd);
$dbh->do("set statistics io on");
$sth = $dbh->prepare("select name from sysusers");
$sth->execute || die $sth->errstr, "\n";
while($aref = $sth->fetchrow_arrayref) {
	print "@$aref\n";
}
$sth->finish;

I got this output:

DBD: :Sybase::db do failed: Server message number=3614 severity=10 state=0 line=1 server=SYB_DEV text=Total writes for this command: 0
DBD: :Sybase::st fetchrow_arrayref failed: Server message number=3615 severity=10 state=0 line=1 server=SYB_DEV text=Table: sysusers  scan count 1,  logical reads: (regular=1 apf=0 total=1),  physical reads: (regular=0 apf=0 total=0),  apf IOs used=0

Server message number=3614 severity=10 state=0 line=1 server=SYB_DEV text=Total writes for this command: 0
dbo
guest
navigator_role
oper_role
probe
public
replication_role
sa_role
sso_role
sybase_ts_role


But when I installed the latest DBI and DBD::Sybase I discovered
$dbh->{syb_err_handler} could be set to \&some_msg_handler.
And now my message handler picks up the statistics messages and
fetch_array() seems much happier.


-Rick Nicoletti


At 04:38 PM 6/21/99 -0700, you wrote:
>Rick Nicoletti writes:
> > Hi all, I was wondering if anyone knew how to turn on statistics
> > io in DBD::Sybase.
> > 
> > For instance, using Sybase::DBlib I can turn on statistics io by:
> >     $dbh->dbsetopt(&DBSTAT, "IO");
> > and then capture the text in the message handler.
> > 
> > I'd like to turn on statistics io using DBI/DBD::Sybase (and capture
> > the statistics text separately from normal row data), but I can't 
> > figure out how.  I tried:
> >     $dbi_handle->do("set statistics io on");
> > but that seemed to confuse later fetches.
>
>Hmmm.. That should work.
>
>What sort of problems are you seeing when you use the do() method for
>this?
>
>Michael
>-- 
>Michael Peppler         -||-  Data Migrations Inc.
>mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
>Int. Sybase User Group  -||-  http://www.isug.com
>Sybase on Linux mailing list: ase-linux-list@isug.com
>
>
>