I am using oracle 10g. I tried to merge two tables. At that time i got the following error…
ora-30926 unable to get a stable set of rows in the source tables.
The following is my query
merge into mt_test_dest t
using (select distinct d.dest_id dest_id,
d.c_id,
nvl(tt.destination, tt.destination) destination
from my_dest_extra d
join mt_test_dest tt
on d.c_id = tt.dest_cid
join my_dest dml
on dml.dest_id = d.dest_id
where tt.effectivedate <> to_date('12-12-2999', 'dd-mm-yyyy')) src
on (t.dest_cid = src.c_id)
when matched then
update set t.dest_id = src.dest_id, t.destination = src.destination;
Can someone help me out in this issue?
The most likely cause for the error is that your source query contains multiple rows with the same
C_ID. If this happens, you have two or more rows competing to update the same data in the target table (since this column is used as the only join condition). Oracle detects this and throws an ORA-30926 error.