0 pts.
 DB2/400 : SQL update error!! help me ^^
DEAR Kent Milligan Thank you for reviewing my question. I am using DB2/400 and want to update 'VALUE' column of TBL1 WITH 'PRICE' of TBL2. Here's description of two tables. TBL1 TBL2 ------------ ------------- ID | VALUE ID | PRICE ------------ ------------- 1 | 10 1 | 100 2 | 20 2 | 200 3 | 30 3 | 300 ------------- ------------- SQL) UPDATE TBL1 SET VALUE=B.PRICE FROM TBL1 A INNER JOIN TBL2 B ON A.ID=B.ID When I run query above I get this error message. "Column qualifier or table B undefined. " But this query works very well on MS SQL-SERVER. Please let me know if this is really impossible or any way to solve??

Software/Hardware used:
ASKED: December 2, 2004  6:33 PM
UPDATED: December 3, 2004  11:11 AM

Answer Wiki:
Try this statement: UPDATE TBL1 A SET A.VALUE=(SELECT B.PRICE FROM TBL2 B WHERE A.ID=B.ID);
Last Wiki Answer Submitted:  December 3, 2004  10:38 am  by  JURGSON   0 pts.
All Answer Wiki Contributors:  JURGSON   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Is the column that you are trying to update part of a primary key?, if it is you can’t update it. It works on SQL Server but no in DB2 or Oracle. PK are not updateable. If it is not, review you join.

 0 pts.