Informix Error -6030: 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 dbupdate() 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
-6030 fires when dbupdate() presents a value duplicating an existing value in a UNIQUE-indexed
column — per the archived catalogue, the row is not inserted.
- A
dbupdate()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.
Examples
N/A
No specific triggering statement is documented beyond the function-level condition described above.
Diagnostic Checks
- Check whether the value being written already exists in the UNIQUE-indexed column.
Related Errors / Related Topics
- -6017 — "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 via dbupdate() — the row isn't inserted.