|
Man, that is lucky if it worked!! And I'm very glad if it did!
Cheers
Vern
On 7/17/2018 3:25 PM, Jeff Crosby wrote:
I think Vern's worked. Further testing after vacation.the
Thanks all. This list is so great.
On Tue, Jul 17, 2018 at 4:24 PM, Jim It <jim_it@xxxxxxxxxxx> wrote:
Jeff,
Select d.ONRCU, d.CWSTS, h.SHPDTISO, c.DATE1
From JEFF.ORDTL d
Inner Join JEFF.ORHDR h On d.ONRCU = h.ONRCU
Inner Join JEFF.BILNGCNT c On h.SHPDTISO = c.DATE1
Where d.CWSTS In('1', '2');
Becomes
Merge Into JEFF.ORDTL as TGT
Using
(Select d.ONRCU, d.CWSTS, h.SHPDTISO, c.DATE1
From JEFF.ORDTL d
Inner Join JEFF.ORHDR h On d.ONRCU = h.ONRCU
Inner Join JEFF.BILNGCNT c On h.SHPDTISO = c.DATE1
Where d.CWSTS In('1', '2')) As SRC On TGT.ONRCU =
SRC.ONRCU When Matched Then Set TGT.CWSTS = '3'
Jim
________________________________
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxx> on behalf of
Jeff Crosby <jlcrosby@xxxxxxxxxxxxxxxx>
Sent: Tuesday, July 17, 2018 4:05 PM
To: Midrange Systems Technical Discussion
Subject: Need an SQL update lesson
Once again I need help with SQL, this time on an update.
This select:
Select d.ONRCU, d.CWSTS, h.SHPDTISO, c.DATE1
From JEFF.ORDTL d
Inner Join JEFF.ORHDR h On d.ONRCU = h.ONRCU
Inner Join JEFF.BILNGCNT c On h.SHPDTISO = c.DATE1
Where d.CWSTS In('1', '2');
gives me the correct records. Now I want to update field (er,
column) d.CWSTS to a literal based on this select.
I found an example that implies this should work:
Update JEFF.ORDTL Set CWSTS = '3'
From JEFF.ORDTL d
Inner Join JEFF.ORHDR h On d.ONRCU = h.ONRCU
Inner Join JEFF.BILNGCNT c On h.SHPDTISO = c.DATE1
Where d.CWSTS In('1', '2');
but it barfs at the "From" so I assume some different syntax for
DB2 on
listIBM i. I feel like I'm this close, but my googling has not
resulted in other examples.
After today I'm on vacation until Tuesday, but I just gotta know . . .
Thanks.
--
Jeff Crosby
VP Information Systems
UniPro FoodService/Dilgard
P.O. Box 13369
Ft. Wayne, IN 46868-3369
260-422-7531
direct.dilgardfoods.com
The opinions expressed are my own and not necessarily the opinion
of my company. Unless I say so.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
listTo post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange
.com_mailman_listinfo_midrange-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOO
HQTwolPvSZ4PFLhr1wDDGs&r=ls1vEGzGwgqZJyzZs7sGJ8CtK97ty2KqTEwuy7Bm0e
k&m=eQSod9ZvgR6-jJaMjYzG4iujvdA-jGASqfBa8JCX6Zw&s=wqZyK0s7gVur8KwJB
Y0JtS0in0JSDUWHeReeSGlLAaA&e= or email:
MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_midrange-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=ls1vEGzGwgqZJyzZs7sGJ8CtK97ty2KqTEwuy7Bm0ek&m=eQSod9ZvgR6-jJaMjYzG4iujvdA-jGASqfBa8JCX6Zw&s=plNsMTxzWhWSFjZNkpToGxIFLyZhIzVJ50glDjI4ro4&e=.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our
affiliate
link:
https://urldefense.proofpoint.com/v2/url?u=http-3A__amzn.to_2dEadiD
&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=ls1vEGzGw
gqZJyzZs7sGJ8CtK97ty2KqTEwuy7Bm0ek&m=eQSod9ZvgR6-jJaMjYzG4iujvdA-jG
ASqfBa8JCX6Zw&s=RlAV-LTQttj49U5LlRytFcCeVjomuDXd2UVZo3uBrAA&e=
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange
.com_mailman_listinfo_midrange-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOO
HQTwolPvSZ4PFLhr1wDDGs&r=ls1vEGzGwgqZJyzZs7sGJ8CtK97ty2KqTEwuy7Bm0e
k&m=eQSod9ZvgR6-jJaMjYzG4iujvdA-jGASqfBa8JCX6Zw&s=wqZyK0s7gVur8KwJB
Y0JtS0in0JSDUWHeReeSGlLAaA&e= or email:
MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_midrange-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=ls1vEGzGwgqZJyzZs7sGJ8CtK97ty2KqTEwuy7Bm0ek&m=eQSod9ZvgR6-jJaMjYzG4iujvdA-jGASqfBa8JCX6Zw&s=plNsMTxzWhWSFjZNkpToGxIFLyZhIzVJ50glDjI4ro4&e=.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our
affiliate
link:
https://urldefense.proofpoint.com/v2/url?u=http-3A__amzn.to_2dEadiD
&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=ls1vEGzGw
gqZJyzZs7sGJ8CtK97ty2KqTEwuy7Bm0ek&m=eQSod9ZvgR6-jJaMjYzG4iujvdA-jG
ASqfBa8JCX6Zw&s=RlAV-LTQttj49U5LlRytFcCeVjomuDXd2UVZo3uBrAA&e=
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.co
m_mailman_listinfo_midrange-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwol
PvSZ4PFLhr1wDDGs&r=ls1vEGzGwgqZJyzZs7sGJ8CtK97ty2KqTEwuy7Bm0ek&m=eQSod
9ZvgR6-jJaMjYzG4iujvdA-jGASqfBa8JCX6Zw&s=wqZyK0s7gVur8KwJBY0JtS0in0JSD
UWHeReeSGlLAaA&e= or email: MIDRANGE-L-request@xxxxxxxxxxxx Before
posting, please take a moment to review the archives at
https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_midrange-2Dl&d=DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=ls1vEGzGwgqZJyzZs7sGJ8CtK97ty2KqTEwuy7Bm0ek&m=eQSod9ZvgR6-jJaMjYzG4iujvdA-jGASqfBa8JCX6Zw&s=plNsMTxzWhWSFjZNkpToGxIFLyZhIzVJ50glDjI4ro4&e=.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://urldefense.proofpoint.com/v2/url?u=http-3A__amzn.to_2dEadiD&d=
DwICAg&c=2S-2xx8Cum_thMfWs-kOOHQTwolPvSZ4PFLhr1wDDGs&r=ls1vEGzGwgqZJyz
Zs7sGJ8CtK97ty2KqTEwuy7Bm0ek&m=eQSod9ZvgR6-jJaMjYzG4iujvdA-jGASqfBa8JC
X6Zw&s=RlAV-LTQttj49U5LlRytFcCeVjomuDXd2UVZo3uBrAA&e=
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.