Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UPDATING db USING DATA IN 2 TABLES

Status
Not open for further replies.

itguymike

Technical User
May 27, 2005
28
US
I am trying to use 2 tables to update date:
UPDATE OPERATION

SET
OPERATION_TYPE='QC TEST (2+118)',SETUP_HRS= '0',
RUN_TYPE= 'HRS/LOAD',
LOAD_SIZE_QTY= '10000',
RUN_HRS= '2',
MOVE_HRS= '118',
MINIMUM_MOVE_QTY= '',
SETUP_COST_PER_HR = '0',
RUN_COST_PER_HR= '25',
RUN_COST_PER_UNIT= '0',
BUR_PER_HR_SETUP= '0',
BUR_PER_HR_RUN= '0',
BUR_PER_UNIT_RUN= '0',
BUR_PERCENT_RUN= '200'

WHERE STATUS= 'U'
and RESOURCE_ID='qc testing'
and PART.PRODUCT_CODE= 'NA BULK'
and part.DESCRIPTION LIKE 'NA/AF%';

the operations table is what i am trying to update but it needs to update the fields based on the part table. each time i run it i get THE MULTI-PART INDENTIFIER PART.PRODUCT_CODE COULD NOT BE BOUND.

any ideas how to get around this?

thanks
 
You need a version of
Code:
UPDATE O 
SET ...
FROM Operation O 
INNER JOIN Part Part ON O.pid = Part.pid;

djj
The Lord is my shepherd (Psalm 23) - I need someone to lead me!
 
THANKS, re ran the sql statment an got an error:
invalid objetc name OPERATION

CODE:
UPDATE OPERATION

SET
OPERATION_TYPE='QC TEST (2+118)',SETUP_HRS= '0',
RUN_TYPE= 'HRS/LOAD',
LOAD_SIZE_QTY= '10000',
RUN_HRS= '2',
MOVE_HRS= '118',
MINIMUM_MOVE_QTY= '',
SETUP_COST_PER_HR = '0',
RUN_COST_PER_HR= '25',
RUN_COST_PER_UNIT= '0',
BUR_PER_HR_SETUP= '0',
BUR_PER_HR_RUN= '0',
BUR_PER_UNIT_RUN= '0',
BUR_PERCENT_RUN= '200'

FROM OPERATION
INNER JOIN PART
ON WORKORDER_BASE_ID=ID

WHERE OPERATION.STATUS= 'U'
and RESOURCE_ID='qc testing'
and PART.PRODUCT_CODE= 'NA BULK'
and PART.DESCRIPTION LIKE 'NA/AF%';

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top