I have the following SQL code (this is how much I've got so far):
MERGE INTO SCHEMA_1.TABLE_1 table1
USING
(
SELECT DISTINCT table2.COLUMN_5,
view1.COLUMN_6
FROM SCHEMA_2.TABLE_2 table2
LEFT JOIN SCHEMA_2.VIEW_1 view1
ON table2.COLUMN_4 = view1.COLUMN_1
WHERE
view1.COLUMN_6 is not null
)t2
ON(table1.COLUMN_2 = t2.COLUMN_5)
WHEN MATCHED THEN UPDATE SET
table1.COLUMN_3 = t2.COLUMN_6
where table1.COLUMN_2 in
(
select
table1.COLUMN_2
from
SCHEMA_1.TABLE_1 table1,
SCHEMA1.TABLE_3 table3,
SCHEMA1.TABLE_4 table4,
SCHEMA1.TABLE_5 table5,
SCHEMA1.TABLE_6 table6,
SCHEMA1.TABLE_7 table7
where
table4.COLUMN_7 = table3.COLUMN_8 and
table5.COLUMN_9 = table4.COLUMN_10 and
table5.COLUMN_11 = table1.COLUMN_12 and
table4.COLUMN_13 = table7.COLUMN_14 and
table7.COLUMN_15 = table6.COLUMN_16 and
table6.COLUMN_17 = 'DOL' and
table4.COLUMN_18 = 1 and
table1.COLUMN_2 is not null and
table1.COLUMN_3 is null
order by
table1.COLUMN_19 desc
);
But I'm getting the below error message:
SQL Error: ORA-30926: unable to get a stable set of rows in the source tables
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
What causes the error? Where to change in the code to make it work?
Thanks for helping out!