perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilia Lobsanov <i...@lobsanov.com>
Subject Re: DBIx::Recordset 0.24 issues
Date Fri, 18 Oct 2002 19:58:45 GMT
On Fri, Oct 18, 2002 at 08:50:48PM +0200, Gerald Richter wrote:
 
> > 3. Is it possible to get count of total records returned when using
> > PrevNextForm with $max
> >
> 
> Set $DBIx::Recordset::FetchsizeWarn = 0 and you will get the total number of
> records with scalar(@set), if your database supports this (i.e. returns the
> number when doing the search)

I'm not using *set as a glob but via "$set = DBIx::Recordset->Search";
scalar(@$set) returns the $max not the total records.
Looking at mysql.log, DBIx::Recordset is using LIMIT 0, $max.

Also, I tried using MoreRecords().
The docs say it does not change the current record, but looks like it
does. The first record is gone. All I'm doing is:

[- $set = DBIx::Recordset->Search($h); -]
[$ if $set && $$set->MoreRecords() $]
[$ while ( my $rec = $$set->Next() ) $]
[# do stuff with $rec #]
[$ endwhile $]
[$ endif $]

First record is skipped.

When I remove the $$set->MoreRecords(), the first record shows up and
all is good.

ilia.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message