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: "Rob Fenstermacher" <fence at bwn dot net>
Subject: Re: How to the no of rows
Date: Apr 29 2000 3:34PM

well, if you are using Sybase::CTlib, one way is to
use the ct_sql() method and then check ROW_COUNT for the # of rows returned.

for example:
$dbh->ct_sql("select * from sysobjects where type='U'");
$rowcnt = $dbh->{'ROW_COUNT');

WARNING:  ct_sql pulls ALL of the rows INTO MEMORY!
                     don't use ct_sql, unless you are pretty sure about the
general rowcount--i.e., 100 rows versus 100 million.

you can also find out the rowcount when using ct_fetch, but only after
fetching all of the records. :)

I hope this helps


interested in the colorado lottery?  Check out

Robert Fenstermacher
Data Conversion Solutions, Inc.
Denver, CO

----- Original Message -----
From: "venkat Reddy" 
To: "SybPerl Discussion List" 
Sent: Saturday, April 29, 2000 8:27 AM
Subject: How to the no of rows

>   hi,
>  How do I know the number of rows in any table? After the select query
executed.How can I find out the query returned 0 rows or x rows?
> see u
> venkat
> chittepu
> e-mail:
> --------------------------------------------------------
> Feed  Your Greed !!!
> Get your 10MB Free space only at NOW!
> --------------------------------------------------------