Informix Error -6017: Cannot add a duplicate value; the index has been defined as UNIQUE.
Cause and resolution
Cannot add a duplicate value; the index has been defined as UNIQUE.
At least one of the column values that was presented to dbadd() is a duplicate of a value that exists in its column. However, that column is constrained to contain unique values. The row cannot be inserted.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-6017 fires when dbadd() is given a value that duplicates an existing value in a column
constrained to be unique — per the archived catalogue, the row is not inserted.
- A
dbadd()call presenting a value already present in a UNIQUE-indexed column, per the archived catalogue — the direct, only cause.
Solutions / Resolution
- Use a value that doesn't already exist in the unique column, per the archived catalogue.
- Confirm whether a true duplicate insert was actually intended — if so, the index design, not the insert, needs reconsidering.
Examples
N/A
No specific triggering statement is documented beyond the function-level condition described above.
Diagnostic Checks
- Check whether the value being inserted already exists in the UNIQUE-indexed column.
Related Errors / Related Topics
- -6030 — "Cannot add a duplicate value; the index has been defined as UNIQUE."
- -6027 — "Cannot insert a NULL value into a NOT NULL column."
A duplicate value for a UNIQUE-indexed column — the row isn't inserted; use a value that doesn't already exist in it.