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



Jim,

You should not need to specify the logical file name in the query. The
query optimizer should be able to figure out the best logical to use.
I've run into cases where logicals that exactly matched the where and
order by clauses were not used. Compiling the programs with
ALWCPYDTA(*YES) took care of the problem.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jim Franz
Sent: Wednesday, March 01, 2006 3:09 PM
To: RPG400-L@xxxxxxxxxxxx
Subject: sqlrpgle select statements

I had an pgm running too long & found that one of 7 different
select statements was scanning the whole file. The fields in the 
where clause were always the same, so i created a logical. Ran again
and was not any faster. Then remembered a comment in SQL at Work book
that
using the logical name in the select statement would work better, and it
did.

The other 6 files have an existing logical where 
at least the first field in the where clause is the same as logical key,

so should i change the select statement to use the best logical name, 
or leave them alone. 
I'm not sure if to only specify a lf name when there is a problem or
always specify?

jim franz
 

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.