|
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. -- [ Picked text/plain from multipart/alternative ] What release of the OS are you one? The SEU syntax checker in V5R1 doesn't like host variables in the Order By clause. Dave -----Original Message----- From: darren@dekko.com [mailto:darren@dekko.com] Sent: Tuesday, October 29, 2002 3:54 PM To: rpg400-l@midrange.com Subject: Embedded SQL Order By with host variables I have a rather large SQL statement and I'm wondering about host variables in the ORDER BY clause because I'd rather not copy it a number of times to just order it differently. I can't find any IBM documentation describing using host variables to specify an ORDER BY clause, but the Precompiler seems to allow it, and the query optimizer said something about host variables in the order by clause being a reason that an ODP might not be re-used. I figured from this that it was permissible. It seems to just whatever entry is in the host variable. Anybody here had success or seen something about this? Thanks in advance. simplified example: ______________________________________ Eval SORT1='FAC' /EXEC SQL SELECT PROD, CLASS, FAC FROM IMAST ORDER BY PROD, :SORT1 /END-EXEC ____________________________________ I've also tried: Eval SORT1=2 /EXEC SQL SELECT PROD, CLASS, FAC FROM IMAST ORDER BY PROD, :SORT1 /END-EXEC ________________________________________ _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com 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.