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: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: NUMBER of affected rows
Date: May 10 2001 2:09PM

Karsten Spakowski writes:
 > Hi folks,
 > I work with the DBI and DBD Module on a Sybase Server 11.9.
 > After the execution of an select statement,  I will check the number of
 > affected row,
 > but I get always the -1.

Please read the DBI manual, and also the Sybase OpenClient manual.

There is no way for Sybase to know how many rows a select will return
without counting them (i.e. without fetching all the rows). So there
is no way for DBD::Sybase to tell you how many rows a select query
will return - it can only tell you how many rows *were* returned after
the query data was completely processed.

The number of rows affected will only be significant for
insert/update/delete queries.

Michael Peppler - Data Migrations Inc. - -
International Sybase User Group -
Sybase on Linux mailing list: