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



Thanks, Walden, for saying so well what I was trying to say. There IS no "generated" statement per se. The stuff is really all done under the covers.

In this case, DBMON showed that the substituted host variables make the statement look like this for the QRFLD = 'QQQ014'

select fhpro, fhonm, fhfamt + fhjamt as qnetfee, fhsua3
from frp001
Order by
case
when 'QQQ104' = 'QQQ104' then fhpro
when 'QQQ104' = 'QQQ105' then fhonm
when 'QQQ104' = 'QQQ111' then fhsua3
else null
end


I tried this, using a file I had with different column names. I don't think it sorted - fetched in arrival sequence, AFAIK. Could it be hitting the NULL? Is it possible that things don't match because of escalating literals to VARCHAR, so the equality test fails?

Reeve, does this actually come out in the sorted order for you? I ran this on V5R3, not V5R2. I put the statement intoa program I called REEVE with a single 6-character parameter QRFLD.

Thanks
Vern


At 12:49 PM 7/12/2004, you wrote:
>Looking at the generated SQL code (with the SQL includes, SQLCA, etc.)
>doesn't tell me much.

It won't. The generated SQL code isn't used to access the data, it's
used to access the SQL engine. The SQL engine is responsible for
figuring out how to retrieve that data. You shouldn't see anything in
the RPG that "understands" how that SQL is run.

The best you can do is run the query in debug, but remember, run the
query against production data. The "right" way to retrieve a row from a
test table with 50 rows isn't the "right" way to get a row from the same
table with 50 million rows.

-Walden

------------
Walden H Leverich III
President & CEO
Tech Software
(516) 627-3800 x11
WaldenL@xxxxxxxxxxxxxxx
http://www.TechSoftInc.com

Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.