Link to home
Start Free TrialLog in
Avatar of Timeless
Timeless

asked on

Viewing "pages" within a large table

Using CF and a very large Oracle table, how do I view "pages" of say 20 records at a time without having to retrieve the entire table each time? I am trying to solve a performance issue here.

Using the SELECT * FROM TABLENAME query may return several thousand records. I need to limit the query somehow by "page" number. eg. I want page 3 of that same query, showing 20 records.

Please help.
Avatar of rod_nolan
rod_nolan

Hi Timeless,

Well, you can limit the number of records returned from a query by setting the maxrows attribute of the cfquery tag to a number (20, for example) but it sounds like you want to create a "next n of m records" interface.

There's a section in Ben Forta's book (the ColdFusion Web Application Construction Kit, p. 498) on that very topic but as far as I understand, you need to execute the query each and every time you click the "Next 20 Records" button and you use a local variable as a pointer to determine which 20 record section of the total recordset to display on the next/previous page.

I know that this doesn't solve your problem but if you want to know more about this approach, let me know.

Good Luck,
Rod
Avatar of Timeless

ASKER

Thanks for the response. I don't have access to that book at the moment. Any chance of explaining the key points to how it works?

Any other comments on how to do this are also still welcome.
ASKER CERTIFIED SOLUTION
Avatar of rod_nolan
rod_nolan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your valuable time. With your assistance I have been able to significantly reduce the database access times. I appreciate your help and keep up the good work!
My pleasure! I'm glad I could help.
Rod