Paul,


I've done something similar with IBM SQL CLI interfaces. But I'm not sure if my design tip will work for all databases. I agree with others that RPG RLA works better for position-to and page navigation. But here goes...

Generate an SQL result set which includes all data - ordered by state in your example. Determine the total number of rows in the result set. Implement code to do a binary search of the result set for the "position to" value. SQL CLI has a "goto row" function that works.

If the result set contains 100,000 total rows, begin with row 50,000 and check the position-to value. Depending on the value, try row 25,000 or 75,000 next, and so forth until you narrow down location of the the position-to value.

Use Prior / Next cursor navigation to implement paging from there.

-Nathan

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.