Scrolling cursors in OCI?

From: David Trahan <p00775_at_psilink.com>
Date: Wed, 17 Nov 93 17:45:26 -0500
Message-ID: <2962661697.0.p00775_at_psilink.com>


Hello!

        I have what I would guess would be a frequently asked question, but doesn't appear in any FAQ I've seen:

How can I have "random" access to the results of a query through an OCI
(NOT Pro*C) cursor?

For example:

        Let's say my code issues a SQL statement like: SELECT a.col1,a.col2,b.col3 from table1 a, table2 b where (a.col1='doink');

(I know the syntax probably isn't perfect, but you get the idea)

The "output" of this query is 30000 rows. The app I'm developing runs on a PC and is displaying the results of the query in a scrollable list box on Windows. Naturally, I don't (perhaps can't) wanna retrieve ALL 30000 rows, keeping 'em all in memory. My plan was to build a cache of rows which my list box is a "window" into. When the user scrolls towards the bottom of the cache, I throw few rows out of memory from the top of the cache, add them to the bottom, and fetch the approprate rows from the database into the new cache rows. Sounds pretty logical to me...

But how the heck to I specify WHICH rows to fetch in OCI? It seems like this sort of thing must be pretty common. Am I just thick?

The only way I can fathom doing this is to store the output of the query in a temp table, then use SELECT from TEMPTABLE where ROWID=... to control which rows I retrieve. This sounds like a cludge to me. There's gotta be a better way.

				Thanx in advance!
					Dave Trahan
					p00775_at_psilink.com
Received on Wed Nov 17 1993 - 23:45:26 CET

Original text of this message