ORA-30926: unable to get a stable set of rows in the source tables
OracleWhat does it mean?
In a MERGE (or updatable join) statement, the source side produced more than one matching row for the same target row. Oracle stopped the operation because it cannot decide which source value to update with.
Why does it happen?
The MERGE ... USING source contains duplicate matches for the ON condition; the source query is not unique on the target key; multiple source rows map to the same target row.
How to fix it
Make the source query unique on the target key. Find duplicate matches: SELECT key_col, COUNT(*) FROM (source_query) GROUP BY key_col HAVING COUNT(*) > 1; Deduplicate the source with DISTINCT or an aggregate/analytic function (ROW_NUMBER), then rerun the MERGE. Make sure the ON condition is selective enough.
More from this engine
- ORA-04068existing state of packages has been discarded
- ORA-01427single-row subquery returns more than one row
- ORA-12899value too large for column
- ORA-08103object no longer exists
- ORA-01843not a valid month
- ORA-14400inserted partition key does not map to any partition
- ORA-01536space quota exceeded for tablespace