I need to update a column based on the inner join of two tables in oracle. I am using Merge as the inner join doesn't support in Update.
Query :
MERGE INTO FAC.CMC_PRSQ_SITE_QA PRSQ
USING(
SELECT PRPR_ID, ADDRESS_TYPE, PRAD_EFF_DT, PRAD_TERM_DT
FROM FSG_WRK.FSG_PRAD_PRSQ_TEMP
) TEMP
ON (TEMP.PRPR_ID = PRSQ.PRPR_ID
AND TEMP.ADDRESS_TYPE = PRSQ.PRAD_TYPE
AND TEMP.PRAD_EFF_DT = PRSQ.PRAD_EFF_DT)
WHEN MATCHED THEN UPDATE
SET PRSQ.PRSQ_NEXT_VER_DT = TEMP.PRAD_TERM_DT
WHERE TEMP.PRAD_TERM_DT > PRSQ.PRSQ_LAST_VER_DT ;
But getting below error :
ORA-30926: unable to get a stable set of rows in the source tables
ORA-06512: at line 2
30926. 00000 - "unable to get a stable set of rows in the source tables"
*Cause: A stable set of rows could not be got because of large dml
activity or a non-deterministic where clause.
*Action: Remove any non-deterministic where clauses and reissue the dml.
Also, please let me know if there is any other option to rewrite this query.