SELECT arinvt.buyer_code_id
FROM arinvt
LEFT JOIN arinvt_vendors
ON arinvt.ID = arinvt_vendors.ARINVT_ID
where arinvt_vendors.vendor_id like 61690
and arinvt_vendors.is_default ='Y'
and arinvt.buyer_code_id is null
update arinvt
set arinvt.buyer_code_id = 66
SELECT arinvt.buyer_code_id
FROM arinvt
LEFT JOIN arinvt_vendors
ON arinvt.id = arinvt_vendors.arinvt_id
(where arinvt_vendors.vendor_id like 61690
and arinvt_vendors.is_default ='Y'
and arinvt.buyer_code_id is null)
SQL Error: ORA-00933: SQL command not properly ended 00933. 00000 - "SQL command not properly ended" *Cause:
< *Action:
I looked at the other (duplicate) question before I posted mine and tried this Update:
UPDATE ( SELECT arinvt.buyer_code_id FROM arinvt LEFT JOIN arinvt_vendors ON arinvt.id = arinvt_vendors.arinvt_id where arinvt_vendors.vendor_id like 61690 and arinvt_vendors.is_default ='Y' and arinvt.buyer_code_id is null )x SET arinvt.buyer_code_id = 66
and I get:
Error report -
SQL Error: ORA-00904: "ARINVT"."BUYER_CODE_ID": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
I'm not sure what I'm doing wrong. Can someone help please, we need this to fix our production system.