Informix Error -26095: Cannot update or delete a row twice in a MERGE statement.
Cause and resolution
Cannot update or delete a row twice in a MERGE statement.
If you do a MERGE operation, the join condition and any filters must be sufficiently strict so that no row of the target table is produced more than once for updating or deleting. The error occurred because the same row was processed twice. The query was terminated abnormally.
Either clean the data source or sources, or make the query more restrictive so that no target table row is produced more than once for updating or deleting.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-26095 fires when the same target-table row is matched more than once during a MERGE
operation — per the official guidance.
- The join condition and filters aren't strict enough, so the same target row is produced more than once for updating/deleting, per the official guidance — the direct, only cause; the query is terminated abnormally when this happens.
Solutions / Resolution
- Clean the source data so it doesn't produce duplicate matches, per the official guidance, or
- Make the
ONjoin condition and filters more restrictive, per the official guidance, so no target row is produced more than once.
Examples
N/A
No specific triggering statement is documented beyond a join/filter combination that matches the same target row twice.
Diagnostic Checks
- Check the source data for duplicate keys relative to the
ONjoin condition, and tighten theONclause or clean the source data.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -26095 in this set yet.
A MERGE statement matched the same target row more than once — clean the source data or
tighten the join condition.