Thilo Planz wrote:


I make a page that returns the result of a select statement in Perl
and DBI, but a lot of rows are returned, there is a way to page the
result ?


Yes, there are several modules for this.

The best one (easy to use, all the functions you need in one place) I've used is Data::Paginate (http://search.cpan.org/~dmuey/)

Paging the data in Perl is the easiest way.

However, it should improve performance if you do this on the database server (in SQL)
and only return the rows you need.


For this, you need to rewrite your SQL.


Agreed! which is why we chose this module also :)

It sends the page's range so you can:

query all records if its the initial query.
(or COUNT(*) the number of records and query 1-n)
then
query the range (like with LIMIT) for the given page after you have the total number of records returned originally


We've been able to create with it a serach feature that does only return the records for say page 2 while keeping the paging info in tact.

I beleive the example the author gave us will be in the docs for it.

I'm telling you that module handles *everything* you'd want to do in regard to paginating data.

Hope its up soon! Next time I work with the author I'll mention this thread to him ;p

HTH :)

Reply via email to