|
From est join rcm on tcust = ccustwhere
I have a static sql statement I'm using in an SQLRPGLE program. Ittakes
about 20 seconds to execute and I need to make it faster if at allczip
possible...any suggestions will be greatly appreciated...
Here is the statement...
Exec SQL
Declare CSZEST1 Cursor For
Select Cast(tcust As Numeric(6,0)), tship, stadtp, tname,
tadr1,
tadr2, tadr3, tste, tpost, tphone
From est
Where tcust not in(Select ccust
From rcm
Where cad3 = (case when :cszESTCity <> ''
then :cszESTCity else
cad3 End)
and cste = (case when :cszESTState<>''
then :cszESTState else
cste End)
and czip = (case when :cszESTZip <> ''
then :cszESTZip else
End)blank
and cmid = 'CM')
and tadr3 = (case when :cszESTCity <> ''
then :cszESTCity else tadr3 End)
and tste = (case when :cszESTState <> ''
then :cszESTState else tste End)
and tpost = (case when :cszESTZip <> ''
then :cszESTZip else tpost End)
and tid = 'ST'
Order By tcust, tship, stadtp;
The data is structured as follows. There are 2 files, RCM and EST. RCM
is the customer master and EST is the address master for customers. So
the key from RCM to EST is CCUST = TCUST.
TSHIP and STADTP together with TCUST form a unique record. What happens
is the user can specify a City, State, and/or Zip. If they are not
I need to use them as inclusion criteria. What I want are any recordsin
EST that meet the City/State/Zip criteria where the master RCM recorddoes
not.use of the individual or entity to which it is addressed and may contain
I hope this is enough clear info.
Thanks
Bryce Martin
Programmer/Analyst I
570-546-4777
--- This message (including any attachments) is intended only for the
--list
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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.