Re: URGENT: fetch previous cursor items?
From: Francis Wang <wangf_at_interaccess.com>
Date: 24 Dec 1993 19:31:19 GMT
Message-ID: <2ffg27$l11_at_mailhost.interaccess.com>
Francis Wang
Intertech Associates, Inc. Received on Fri Dec 24 1993 - 20:31:19 CET
Date: 24 Dec 1993 19:31:19 GMT
Message-ID: <2ffg27$l11_at_mailhost.interaccess.com>
John Barton (jbarton_at_empros.com) wrote:
: Is there a method for fetching the previous items in a cursor?
: I'm trying to use a scrolling list and only store the visible items in memory
: at any one time. (i.e. I want to get the next 'n' items when the user
: scrolls down, and the previous 'n' items when they scroll up)
: John Barton (jbarton_at_empros.com)
If your query can be ordered by an unique index then you can use the following technique:
- Display rows in the order of the unique index.
- When you're going forward store the index key (in memory) of the rows you retrieved.
- When you need to scroll up, close the current cursor and open a new cursor that has the query defined as'order by key desc' with a where clause : 'where key < last_index_value'.
I would recommand buffer more rows than just a screen full. This technique is used by some vendors to implement scrolling.
Francis Wang
Intertech Associates, Inc. Received on Fri Dec 24 1993 - 20:31:19 CET