× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ron,
Look into the PREPARE statement. You can essentially build the ORDER BY clause
and the rest of the statement dynamically using SQL's substitution symbols (a
question mark).

-Bob Cozzi
www.iSeriesTV.com
Ask your Manager to watch iSeriesTV.com


-----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 



                        
---------------------------------
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small
Business.

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.