× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



David,

Closing the cursor might have a performance impact that you aren't expecting. Though, I have to admit that it's what I usually do, because I'm working in an MVC paradigm where I want my business logic to be "stateless", so I can't maintain a cursor position between calls.

But, assuming you don't need to be stateless.... If you're trying to implement a single-page load subfile with SQL, consider using a scrollable cursor, and using the FETCH statement. Fetch can be coded with FIRST, LAST, NEXT or PRIOR to let you fetch the first record in the result set, the last record in the result set, the next record, or the prior record, respectively.

It's not quite like SETLL -- you can't position to a particular key in the result set -- but you don't really need to position by key when filling a subfile. You only need to be able to move forward and backward, really. To scroll forward, you only need to know the page size, and run a loop (or fetch into an array) that fetches the next X records. To scroll backward, you need to know how many records you loaded onto the current screen, plus the page size, so you can scroll backward first by what's on the screen (to position the cursor before them) THEN read the previous X number of records into your subfile. With a little planning, it's actually very easy.


David Foxwell wrote:
I'm looking at a progrram that does charges a subfile with SETLL
followed by READE on ROLLUP, SETGT followed by READPE on ROLLDOWN.

What would be the equivalent in SQL if I wanted to replace the
SETLL/GT?

Close cursor?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.