Informix Error -3101: The column column-name does not allow null values.
Cause and resolution
The column column-name does not allow null values.
When you added data to a table, you did not specify data for the column shown. However, that column is defined in the database as not allowing null values. You cannot add the row unless you supply a value.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-3101 fires when adding a row leaves a NOT NULL column without a value — per the official
guidance, the row cannot be added unless a value is supplied for that column.
- No value supplied for a
NOT NULLcolumn while adding a row, per the official guidance — the direct, only cause.
Solutions / Resolution
- Supply a value for the column before adding the row, per the official guidance.
Examples
Checking which columns disallow null
SELECT colname FROM syscolumns c, systables t
WHERE c.tabid = t.tabid AND t.tabname = 'orders' AND c.coltype >= 256;
-- 256 is added to a column's base coltype when it is NOT NULL
Diagnostic Checks
- Check which columns on the table are
NOT NULL(via Informix SQL's Tables menu, Info selection, is simplest), and supply values for all of them before adding a row.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -3101 in this set yet.
A required (NOT NULL) column was left empty while adding a row — supply a value for it.