Forums Register Login

Resultset display

+Pie Number of slices to send: Send
hi i m begineer i need an idea from u for displaying resultset in terms of 10 records so that there must be prev and next buttons so that i can access previous or next records relative to the present records and number of records /total no.of records.pls respond to me regards
[ February 27, 2006: Message edited by: rai talari ]
+Pie Number of slices to send: Send
Hi, this is a common situation and there are a number of solutions.

1) Get rows by numbers. For the first page do your query, take rows 1..10. For the second page, repeat the same query, take rows 11..20. Your database may support syntax that lets you select only "n" rows or even select them by row number. May not get consistent results if other people add and remove rows while you're looking at a page.

2) Get rows by keys. Select the first page. To get the second page select rows with keys higher than row 10. Can't go backwards. May not be consistent.

3) Get all the data and keep it. Copy all rows from the result set into some collection and keep it on the session. You can navigate around the collection by row numbers. May eat up tons of memory for data that is never used. Gets out of date if others add/remove rows.

4) Get all the keys and keep them. Copy all the primary keys from the result set into a collection and keep it. Retrieve the rows you need by the primary keys. Much smaller in memory than #3. Gets out of date.

5) Keep an open cursor on the session. I don't know much about this one, but it sounds expensive.

Any other ideas? Make out a little matrix of the pros and cons for each of these and see if any suit your application. Let us know what you come up with!!
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 969 times.
Similar Threads
displaying fixed number of records on a page
Check the result set
Resultset display
HANDLING RESULTSET
how to read few records at a time?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:14:58.