Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> how do you do pagination in a web app with oracle

how do you do pagination in a web app with oracle

From: Robert Yeh <robert.yeh_at_qwest.com>
Date: Wed, 20 Jun 2001 10:23:23 -0400
Message-ID: <9gqbbd$85a$1@bob.news.rcn.net>

Just wondering how does people do their pagination in their web application with Oracle.
Say my sql returns 1000 rows. My web GUI displays first 50 rows. I have page number 1 - 20 showing on my GUI. If user clicks number 11, it executes the same SQL but displays records 501-550.

This is my approach:

  1. do a count(*) of the sql to determine how many rows will be returned.
  2. select field1, field2 from (select field1, field2, rownum record_number from my_table where ....) where record_number between 501 and 550.

So the SQL always return only 50 rows.

Any other suggestions?

Thanks
Bob Received on Wed Jun 20 2001 - 09:23:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US