Le 04.04.2014 21:56, Sergiy Zuban a écrit :
> Hi Laurent,
>
> The following code doesn't work:
>
> my $statement = $join->select(
> -result_as => 'statement',
> -page_size => 10,
> );
>
> $statement->goto_page( 3 );
>
> foreach my $row ( @{ $statement->page_rows } )
> {
> }
>
>
Hi Sergiy,
While working on the ->goto_page() bug, I realize that this API doesn't
really make sense, especially since I merged your changes about
->finish(), because once a sth handle is finished it cannot be scrolled
to another offset, even if the DBMS supports scrollable cursors (like
Oracle).
Paging should be done when creating the request, with no "goto" after
that; so I'm considerint dropping methods ->goto_page(), ->shift_page(),
etc. from the API. Apparently you were the only person to use it, since
you discovered that bug after many years !
So would it be OK for you if those methods disappear? Your example code
could already be rewritten as :
my $page_rows = $join->select(
-page_size => 10,
-page_index => 3,
);
foreach my $row ( @$page_rows )
{
}
Thanks in advance,
Laurent Dami