|
Ron, Check out the archives. There have been a couple of in dept threads on this subject in recent weeks. IIRC there are many suggestions and code postings to achieve the results you want. Try searching on subfile with something like sort or resequence. Using position to as a key might help too. Rick
-----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Ronald Newman Sent: Thursday, August 31, 2006 4:13 PM To: rpg400-l@xxxxxxxxxxxx Subject: SQL Statement 'ORDER BY' I have a question about embedded SQL in an RPGLE program. The requirement of the application is to display a set of data on a screen and then let the user select which field to sort on and then display the data in that order. I know that I could create a logical file using each possible selection. However this seems to be a lot of over head. So I thought I would use SQL and on the 'ORDER BY' statement I would use a variable and fill that with the literal I wanted to sort on like you can do with most of the statements in SQL. However by my research it looks like you must use either the field name or the position in the file. Has anyone ever done anything like this and if so can you give me some suggestions? Thanks Ron
Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.
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.