freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- 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
-
Dumb DBD::Sybase question.,
Jaye Mathisen, 09/27/1999
- <Possible follow-up(s)>
- Re: Dumb DBD::Sybase question., Michael Peppler, 09/27/1999
- Re: Dumb DBD::Sybase question., Bob Kline, 09/27/1999
Archive powered by MHonArc 2.6.24.