|
|
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
Rob
---
interested in the colorado lottery? Check out http://colotto.com
Robert Fenstermacher
Data Conversion Solutions, Inc.
Denver, CO
fence@bwn.net
----- 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: chittepu@forindia.com
>
>
>
>
> --------------------------------------------------------
>
> Feed Your Greed !!!
> Get your 10MB Free space only at http://www.forindia.com NOW!
>
> --------------------------------------------------------
>
|