|
In addition to the RELATIVE mentioned here, you might consider having the system maintain the subfile page-up i.e. sflsize = sflpage + 1. But then your 'Position to. . .' will always start at the top. joeM ----- Original Message ----- From: "Dan Bale" <dbale@xxxxxxxxxxxxx> To: <RPG400-L@xxxxxxxxxxxx> Sent: Wednesday, October 13, 2004 10:09 AM Subject: subfile page up & down using embedded SQL > Esteemed listers: > > I thought I had seen references to this before, but I am coming up empty > searching the archives both from the search page and from google. > > I have a subfile inquiry app that currently loads the subfile a page at a > time via SETLL and a READ loop. Paging works as expected; Page Down gets > the next set of records following the one appearing at the bottom of the > current page, and Page Up gets the set of records prior to the one appearing > at the top of the current page. There is also a "Position To:" entry at the > top that invokes the SETLL. > > I am attempting to introduce new features that require SQL FETCH to replace > the SETLL, READ, and READP operations. (Note, FWIW, this is _not_ READE or > READPE.) Well, not really sure how to replace the SETLL part. I think I > understand that I would use FETCH NEXT to emulate READ and FETCH PREVIOUS to > emulate READP. > > I think I would know how to handle the Page Down routine --- just do another > iteration of FETCH NEXT for a new page. But the Page Up routine, this one's > a bugger. Since I load a subfile page from top to bottom, the SQL cursor is > positioned at the record that appears at the bottom of the subfile. In > normal RPG I/O, when a Page Up is requested, I would just SETLL using the > first subfile record, and READP from there. I'm just not getting how I > would accomplish this using embedded SQL. > > And if someone has a template that shows how to code a inquiry-only subfile > using SQL and is willing to share it, all the better. > > FWIW, References I've found thus far: > iSeriesNetwork: Paul Conte's "SQL Crib Sheet for RPG Programmers", March > 2000, article #3326 > David Morris: http://archive.midrange.com/midrange-l/199911/msg01499.html > > tia, > db > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. >
As an Amazon Associate we earn from qualifying purchases.
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.