Informix Error -971: Integrity violations detected.
Cause and resolution
Integrity violations detected.
The user has attempted to change the object mode of a disabled constraint or disabled unique index to the enabled or filtering mode, but the SET statement fails because the table contains data that violates the constraint or the unique-index requirement. If a violations table has been started for the table that contains the inconsistent data, this message is returned to the user. The message is returned whether or not the SET statement included the WITH ERROR option.
Similarly, when an INSERT, DELETE, or UPDATE statement causes some records to be added to the violations table because the statement violates a filtering-mode object, this message is returned to the user if the following two conditions are true:
* The SET statement or CREATE statement that specified the filtering-object mode for the object included the WITH ERROR option.
* No other errors have been encountered during the execution of the INSERT, DELETE, or UPDATE statement.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-971 fires in the violations-table / filtering-mode subsystem: it means a statement that should have succeeded cleanly instead found rows that violate a constraint or unique-index requirement, and a violations table is in place to catch them.
- A
SET CONSTRAINTS/SET INDEXESstatement re-enabling (or setting to filtering mode) a disabled constraint or disabled unique index on a table that already has rows violating it, per the official guidance — the table's existing data doesn't satisfy the requirement being turned back on. - An
INSERT,DELETE, orUPDATEagainst a table with a filtering-mode object, where the object's mode was set with theWITH ERRORoption, and the statement itself encountered no other errors — per the official guidance, this combination routes violating rows into the violations table and returns -971 rather than failing the whole statement outright. - A violations table already started for the target table, per the official guidance — this error assumes one is in place to receive the inconsistent rows; without it, the underlying constraint or index failure would surface differently.
Solutions / Resolution
- Inspect the violations table for the rows that failed the constraint or unique-index check — it holds exactly the data that's blocking the mode change or statement.
- Correct or remove the offending rows, then retry the
SETstatement that re-enables or re-filters the constraint/index. - If the error came from a routine
INSERT/UPDATE/DELETEagainst a table withWITH ERRORfiltering-mode objects, treat -971 as informational: the statement completed and the violating rows were diverted, per the official guidance — check the violations table rather than assuming the whole statement failed.
Examples
Re-enabling a constraint against dirty data
ALTER TABLE customer MODIFY CONSTRAINT (cust_email_chk) DISABLED;
START VIOLATIONS TABLE FOR customer;
-- rows are inserted that would fail cust_email_chk while it's disabled
SET CONSTRAINTS (cust_email_chk) ENABLED;
-- -971: Integrity violations detected.
SELECT * FROM customer_vio;
-- shows the rows that don't satisfy cust_email_chk
Diagnostic Checks
- Query the violations table (
<table>_vio) associated with the target table to see the specific rows at fault. - Check the diagnostics table (
<table>_dia), if started, for the specific constraint or index that each violating row failed. - Confirm whether
WITH ERRORwas specified on theSET/CREATEstatement that put the object into filtering mode — it determines whether -971 accompanies a statement that otherwise succeeded, or blocks a mode change outright.
Related Errors / Related Topics
- -973 — "Cannot insert from the violations table to the target table." The specific failure when trying to copy corrected rows straight back from the violations table into a target that still has filtering-mode objects.
- -975 — "Invalid object and object mode combination." The general rule -971 is a data-driven instance of: an object/mode pairing that the current table contents don't support.
- -978 — "No insert permission on the violations/diagnostics tables." A privilege-level reason the same violations-table mechanism can fail, distinct from -971's data-content reason.
-971 means the violations-table mechanism did its job — it caught rows that don't satisfy a constraint or unique-index requirement. Check the violations table for the specific rows before assuming the whole operation failed.