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

oops--there was a typo in my original message.  At least one that I
noticed-there are probably others :)

the $rowcnt line should be:

$rowcnt = $dbh->{'ROW_COUNT'};

I had a close parenthesis, instead of a close curly-brace

Rob

----- Original Message -----
From: "Rob Fenstermacher" 
To: "SybPerl Discussion List" 
Sent: Saturday, April 29, 2000 9:34 AM
Subject: Re: How to the no of rows


> 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!
> >
> > --------------------------------------------------------
> >
>