MC Press Web Site Staff
** This thread discusses the Content article: Embedded SQL and Dynamic Sorting Subfiles0
padshore@optonline.net
Hi Kevin I have been given a project that requires the need to display, within a subfile, the data from 2 seperate files with the ability to sort the data from a number of different columns. So I thought to myself, this smacks of embedded SQL and Dynamic Sorting Subfiles, but wait, that title is somewhat familiar. With a rising of hope and confidence, I searched for your article, which I had read some time ago. The unfourtunate thing is that the data I have to display is over 15,000 records long (and growing) so I am looking for an example of "Embedded SQL and Dynamic Sorting Subfiles - Page at a time (with the ability to position to a particular piece of data)" Some title for an article huh? If you have an example of what is required, or could point me in some direction, I would be very grateful. Thanks in advance Alan Shore
Guest.Visitor
Alan, You aren\'t the only one with the issue. I am looking at the exact same requirements....and 6+ months later, I still can\'t find a simple solution. I suspect the answer lies in programmatically saving the before/after keys and recreating the SQL command for each page load. But, if this is the answer, how efficient can that be? Any help by anyone would be appreciated. Paul Thieme
apirom9
Actually, you can do this by Open SCROLL CURSOR (with ORDER BY you want) in SQLRPGLE and use FETCH RELATIVE when user press Page-Up Button / use FETCH NEXT when user press Page-Down Button. If user press some key (F9, F14, etc...) to sort data based on the column they want, you just simply close the old CURSOR and reopen it again with new ORDER BY that you choose.
padshore@optonline.net
I investigated using Dynamic SQL for different sorts of data onto a subfile, and you are right. By using FETCH RELATIVE, you are able to \'page-up\' and \'page-down\' very effectively. The problem I was having was due to the fact that the sub-file that I had to produce was a page-at-a-time sub-file. This entailed giving the user the option of positioning to a certain point, and then filling the sub-file data from that point. That by itself is not the problem, neither is page-down, but how do you page-up from that point? Alan
Scott Sims
Try using FETCH PRIOR to page up. This works like READP. Scott
Please login to make comments.
User Rating: / 0
PoorBest 

WHITE PAPERS

The following White Papers can be found at the MC White Paper Center

 

 


   MC-STORE.COM