Informix Error -1225: Column does not admit a NULL value.
Cause and resolution
Column does not admit a NULL value.
This statement attempted to store a null value in a column that has been defined as not allowing nulls. Review the definition of the table, and revise the statement so that it supplies values for all required columns.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1225 fires when a statement tries to store NULL in a column defined NOT NULL — per the
official guidance, the statement needs to supply values for all required (non-nullable) columns.
- An
INSERTomitting a value for aNOT NULLcolumn, per the official guidance — the direct, common cause. - An
UPDATEexplicitly setting aNOT NULLcolumn toNULL, the other way this condition arises. - A source value that's itself
NULL(from a join, a subquery, or an unpopulated variable) flowing into aNOT NULLcolumn.
Solutions / Resolution
- Review the table's definition, and revise the statement to supply values for all required columns, per the official guidance.
Examples
An INSERT omitting a required column
-- status is NOT NULL
INSERT INTO orders (order_id) VALUES (1);
-- -1225: no value supplied for status
Corrected
INSERT INTO orders (order_id, status) VALUES (1, 'pending');
Diagnostic Checks
- Check the table definition for which columns are
NOT NULL, and confirm the statement supplies a non-null value for each.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -1225 in this set yet.
A NOT NULL column was left without a value — supply a non-null value for every required
column.