I'd replace each of the join files with an EXISTS clause. Since you used the simple join syntax, we treat that as an inner join type, which can be determined via the exists clause.

Update tfactlib/FLROUTG
Set FLWORKC = 9155
Where FLWORKC = 3155
and ILDDM1 >= .25
and BOMDATEF < 20120305 and BOMDATDS > 20120305
and EXISTS (Select * from tfactalib/BOMMSTR
where BOMPARNT = FLPRODNO)
and EXISTS (Select * from tfactlib/ildpf
where BOMCHILD = ILDINO)

hth,
-Eric DeLong

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Gqcy
Sent: Monday, March 05, 2012 9:54 AM
To: midrange-l@xxxxxxxxxxxx
Subject: turn a select into an update (with multiple joins)

The following SQL returns the list of records I want to update:

select FLWORKC, FLPRODNO, BOMCHILD
from tfactlib/FLROUTG
join tfactalib/BOMMSTR on BOMPARNT = FLPRODNO
join tfactlib/ildpf on BOMCHILD = ILDINO
where FLWORKC = 3155
and ILDDM1 >= .25
and BOMDATEF < 20120305 and BOMDATDS > 20120305


I want to "SET FLWORKC = 9155"










This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 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].