It is a common design for a commercial web site to display a large record set in separate pages. But it may not be efficient (if possible at all) to keep the database connection and record set handles across sessions, as you will never know when the client will finish and release the resources.
It would be much easier to implement record set display paging in separate queries. That is to make a new query every time a new page of records is required. For example, if 200 records are returned and the first page of 10 is on the screen, the visitor can click "next page" to get the 11th to the 20th records. The web page will submit the same query again (as the previous one has been completed and resources released) but start retrieving from the 11th record. If the visitor click, say, page 6 on the page navigation bar, the web page will again submit the query and go straight to record 51 and start retrieval from there.
The "database" command handles this mechanism automatically and neatly. The "Paging Variables" of the database object are for this purpose. But before we do into the details of those variables, we need to explain how the display paging work.
|