DB2/400 : SQL update error!! help me ^^

0 pts.
Tags:
Development
SQL
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??
ASKED: December 2, 2004  6:33 PM
UPDATED: December 3, 2004  11:11 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Try this statement:
UPDATE TBL1 A SET A.VALUE=(SELECT B.PRICE FROM TBL2 B WHERE A.ID=B.ID);

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Inoboa
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following