On 2/11/11 5:43 AM, Charles Wilt wrote:
<<SNIP>>

where
(tadr3 = '' or tadr3 = :cszESTCity)
and (tste = '' or tste = :cszESTState)

OnThu, Feb 10, 2011 at 4:59 PM, Bryce Martin wrote:
I have a static sql statement I'm using in an SQLRPGLE program. It
takes about 20 seconds to execute and I need to make it faster if
at all possible...any suggestions will be greatly appreciated...
<<SNIP>>


While unlikely to assist for performance, all of those predicates in the above form [in parentheses], are easily rewritten having used the IN predicate instead. The following two logical expressions are equivalent, and IMO using the IN predicate is "prettier" for not having to repeat the field name:

( SpecificField = '' OR SpecificField = :SomeVariable )

SpecificField IN ( '', :SomeVariable )

Regards, Chuck

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.