oracle - Update value from a select statement -


I am using an access to Oracle database system (basically using the code for access to the form And entering the table) and trying to update the fields in the table with the value of the same name field in the table. The code I am using is:

 . Common Text = "Update" & amp; Sturshmi & amp; ".TBL_CAPITAL_MGMT_PRODUCT An Inner Join" & amp; Sturshmi & amp; ".TBL_CAPITAL_MGMT_TEMP_LOAD b on a.AR_ID = b.AR_ID SET a.TOT_RWA_AMT = b.TOT_RWA_AMT;"  

that gives an error about missing the SET keyword ... so I changed it to:

 . Comand Text = "Update (SELECT a.TOT_RWA_AMT, b.TART_RWA_AMT as" & amp; strSchema and ". TBL_CAPITAL_MGMT_TEMP_LOAD New_RWA_AMT from an INNER JOIN" & amp; strSchema & amp; ".TBL_CAPITAL_MGMT_PRODUCT B on B.AR_ID = a. AR_ID where a.New_Rec is & lt; & gt; '-1' and a.IP_ID is not a null) C set C. New_RWA_AMT = c.TOT_RWA_AMT; " 

Non-key protected Returns an error about the table. B is a PK of ARIID in the table but there is no primary key in the table and it is probably not being one, I can not update the structure in a table.

I / * + BYPASS_UJVC * / which allows code to run but does not actually do anything.

Has anyone got any ideas where I should go from here?

Thanks

Ignore irrelevant ado codes Doing, whatever you are trying to do is:

update TBL_CAPITAL_MGMT_PRODUCT an INNER JOIN SET a.TOT_RWA_AMT = b.TOT_RWA_AMT;

It is not supported by Oracle (although this unacked biopsy_UJVI signal is supposed to overcome it, but I still did not know it).

Given that your inline view version fails due to constraints of obstacles, you may have to come back to the traditional Oracle approach using correlated subkeys:

 < Code> UPDATE TBL_CAPITAL_MGMT_PRODUCT A SET a.TOT_RWA_AMT = (SELECT b.TOT_RWA_AMT to TBL_CAPITAL_MGMT_TEMP_LOAD b WHERE a.AR_ID = b.AR_ID) where exists (SELECT NULL WHERE a.AR_ID = b.AR_ID from TBL_CAPITAL_MGMT_TEMP_LOAD b);  

The last WHERE clause is to prevent TOT_RWA_AMT from being set to any "one" row on the tap, which does not have the matching "B" row if you know that it never happens You may remove the WHERE section.


Comments