Skip to Content.
Sympa Menu

freetds - Re: Dumb DBD::Sybase question.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Peppler <mpeppler AT peppler.org>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Dumb DBD::Sybase question.
  • Date: Mon, 27 Sep 1999 17:32:59 -0700 (PDT)


Jaye Mathisen writes:
>
>
> playing around with DBD::sybase some more.
>
> Is ->rows only valid after all rows are read?
>
> ie
>
> $sth -> prepare ("some statement");
>
> $sth-> execute;
>
> while ( @x = $sth->fetchrow) {
> $i = $sth->rows;
> }
>
>
>
> $i only gets the correct value after the last row is fetched.
> The rest of the time it's -1;

This is normal. If you read the DBI docs on the rows() method you'll
see that this is the case for most database engines. In reality
DBD::Syabse calls ct_res_info() to get the row count, and this
information is only available once all the rows have been processed
(ie the server doesn't calculate the number of rows that match a
select because that would take more time...)

Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler AT peppler.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list AT isug.com




Archive powered by MHonArc 2.6.24.

Top of Page