You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Ilia Lobsanov <il...@lobsanov.com> on 2002/10/18 19:59:26 UTC

DBIx::Recordset 0.24 issues

1. There seems to be a bug in DBIx::Recordset PrevNextForm. When specifying
the -goto parameter, the Goto button is returned even if there are no
(more) results.

2. Is it possible to put the PrevNextForm before iterating $set->Next
I tried to do it, but the first record would get lost.

3. Is it possible to get count of total records returned when using
PrevNextForm with $max

ilia.

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


Re: DBIx::Recordset 0.24 issues

Posted by Gerald Richter <ri...@ecos.de>.
> 
> 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.
> 

Yes, that's true (I forgot about this optimizsation for mysql)

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

The first one is a little special, you can add a Reset and it will work:

>All I'm doing is:
> 
> [- $set = DBIx::Recordset->Search($h); -]
> [$ if $set && $$set->MoreRecords() $]

[- $$set -> Reset -]

> [$ while ( my $rec = $$set->Next() ) $]
> [# do stuff with $rec #]
> [$ endwhile $]
> [$ endif $]
> 

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




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


Re: DBIx::Recordset 0.24 issues

Posted by Ilia Lobsanov <il...@lobsanov.com>.
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


Re: DBIx::Recordset 0.24 issues

Posted by Gerald Richter <ri...@ecos.de>.

> 1. There seems to be a bug in DBIx::Recordset PrevNextForm. When
specifying
> the -goto parameter, the Goto button is returned even if there are no
> (more) results.
>

Yes, because you can go back via the goto button

> 2. Is it possible to put the PrevNextForm before iterating $set->Next
> I tried to do it, but the first record would get lost.
>

No, it has to come after the iterating

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

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




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