Michael,
Sorry, I just read my post and realized I misread the file names you were using
for the join and where clause. Ignore my previous post.
Rick
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [
mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of Chevalier, Rick
Sent: Tuesday, June 26, 2007 10:39 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: RE: Exception SQL Question
Michael,
I think what you have is a situation where you are returning records from
F4211la that are not in F59912. Then you are asking to only see the records
that are also in F59911. Because you are asking for exceptions, any records
returned fail the test in your where clause.
Try removing the where clause and see what you get. If that gets you closer
(returns some records) you might try moving the select from the where clause to
the top and create a temp table. It would look something like this: (not
tested)
With temptable as (select DISTINCT * from ajdevmdta.F59911 where CCTYPE = 'AB')
SELECT DISTINCT SDKCOO,SDDOCO,SDDCTO,SDLNID,SDMCU
FROM ajdevjdta.F4211la
EXCEPTION JOIN temptable ON
SDKCOO = CBKCOO
and SDDOCO = CBDOCO
and SDDCTO = CBDCTO
and SDLNID = CBLNID
and SDMCU = CBMCU
WHERE SDLNTY = 'S' and SDNXTR <= '560'
for READ ONLY
HTH,
Rick
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [
mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of Ala, Michael A
Sent: Tuesday, June 26, 2007 9:28 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Exception SQL Question
I am trying to determine Changes to an Order
A baseline is Taken (Detail-F59912)
And then the JDE Order Detail File Is compared to that
SELECT DISTINCT SDKCOO,SDDOCO,SDDCTO,SDLNID,SDMCU
FROM ajdevjdta.F4211la
EXCEPTION JOIN ajdevmdta.F59912 ON
SDKCOO = CBKCOO
and SDDOCO = CBDOCO
and SDDCTO = CBDCTO
and SDLNID = CBLNID
and SDMCU = CBMCU
WHERE SDDOCO in
(select DISTINCT CCDOCO from ajdevmdta.F59911 where CCTYPE = 'AB')
and SDLNTY = 'S' and SDNXTR <= '560'
for READ ONLY
This is not returning any results
Yet there is differences in the Data (SDMCU<>CBMCU on 2 Lines of the
Order)
One difference That I have identified is the Line number types are different
Packed and Zoned could that be creating an issue
I changed and SDLNID = CBLNID to and char(SDLNID) = char(CBLNID) and got the
same result
Any help with this Sql Statement would be appreciated
Thanks
Mike
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list 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.
Privileged and Confidential. This e-mail, and any attachments there to, is
intended only for use by the addressee(s) named herein and may contain
privileged or confidential information. If you have received this e-mail in
error, please notify me immediately by a return e-mail and delete this e-mail.
You are hereby notified that any dissemination, distribution or copying of this
e-mail and/or any attachments thereto, is strictly prohibited.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list 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.