|
-----Original Message----- From: rpg400-l-bounces+cwilt=meaa.mea.com@xxxxxxxxxxxx [mailto:rpg400-l-bounces+cwilt=meaa.mea.com@xxxxxxxxxxxx] On Behalf Of Alan Shore Sent: Thursday, August 03, 2006 12:25 PM To: RPG programming on the AS400 / iSeries Subject: Re: Even more embedded SQL.... Thank you EVERYBODY Booth - you and I must be on the same wavelength, or in mutual mind-meld mode or something. I want to take time to thank everyone who has replied to my question, with suggestions, ideas, thoughts, other questions and especially examples. I think I have a handle on everything that I need in relation to what is required for SQL and Dynamic sort building, but what bothers me is the position to aspect of SQL, where the file data is rebuilt, with the first record being equal to or greater than the value that was requested to be positioned to. The problem of paging up from that point (before the first record) will mean yet another re-creation. So I was thinking of a couple of things 1/. Load the first 9,999 records into a load all sub-file. If the user wants to go above that, recreate the data and load the next 9,999 records etc. etc. If the user wants to position to a value AND its within this 9,999 NO PROBLEM If its outside the range , recreate the data and load the applicable 9,999 records into the sub-file.
"Position to" with a load-all subfile? How are you going to do that? Save the subf RRN and key so you can have a particular page put back out. Have you thought about the effect that having multiple sortable columns would have? If the results are sorted by color, then as a user I'd want to position to a color. If the results are sorted by name, then I'd want to position to by name.
2/. Create a file (via DDS) with all the fields defined COL1, COL2, COL3, COL4, COL5, COL6, COL7 and an additional field which is in effect equal in size to ALL the fields CONCATENATED. This field would now be the key of the file, and depending upon what sort is required, build this field accordingly for example if the sort is COL1, COL2, COL3, COL4, COL5, COL6, COL7, the this key field is created as COL1 concat COL2 concat COL3 concat COL4 concat COL5 concat COL6 concat COL7 and then use regular RPG to handle the page up, page down, position to page-at-a-time sub-file Anybody any thoughts on either of these 2 ideas?
The problem with this idea is that DB I/O is pretty expensive. You'd get much better performance writing to a user space instead. HTH, Charles Wilt -- iSeries Systems Administrator / Developer Mitsubishi Electric Automotive America ph: 513-573-4343 fax: 513-398-1121
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.