Bogeybetsy
325 pts. | Aug 27 2009 7:00AM GMT
Hi Phil,
Thanks for the answer. I have the proper indexes. When I do the SQL statements interactively, they’re fast. It’s the cursor I’m having problems with. If I do the “scrollable” cursor thing, won’t I be loading all records in main memory? Wouldn’t that be a problem if I have multiple users? And besides, when I use a scrollable cursor, how do I implement a “Position To” function?
Allan
Philpl1jb
24530 pts. | Aug 27 2009 10:35AM GMT
Don’t know why you want to go back to those records if you’re creating a growing subfile
As I understand it, the fetch is somewhat equlivant to a read. Create the cursor once over the file .. that’s about the same as opening the file and then use it throughout the process.
Vatchy
670 pts. | Aug 28 2009 2:38PM GMT
When you create the cursor you are, in effect, creating a logical view over the file. Actual records are not retrieved until the fetch statement runs.
Don’t close the cursor after you have loaded your each page. When a page key is pressed, either read the next 19 records (PgDn) or read the previous 38 (PgUp) and then load your subfile again.
You only need to close and re-open the cursor if you need to position to a specific record.






