We help IT Professionals succeed at work.
Get Started

Update sql statement with 2 tables

wellhole
wellhole asked
on
953 Views
Last Modified: 2012-05-10
I'm trying to update a table that where there are 2 keys to join to another table. What I have definitely does not work. The version of DB2 I'm running is on an as400 v5r3, so merge and recursion is not available, as far as i know. Any ideas? I'm hoping there's something simple so I don't have to use a cursor iteration...
UPDATE TESTDATA . VCOCOALC
SET ( CLDEL , CLCCTD) = ( 'D' , @CCTD ) 
from  session.orders 
WHERE CLDEL = 'A' AND CLSEQ = session.orders.seq AND CLCCTD = session.orders.cctd

Open in new window

Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE