ORA-01400: cannot insert NULL into (column)
OracleWhat does it mean?
A NULL value was inserted into, or set on, a column with a NOT NULL constraint. A mandatory field cannot be left empty.
Why does it happen?
No value supplied for a mandatory column in an INSERT, an UPDATE setting the column to NULL, no DEFAULT defined for the column, or an empty value coming from a subquery/application.
How to fix it
Supply a valid value for the column named in the error message. Define a sensible default for the column: ALTER TABLE my_table MODIFY (my_column DEFAULT 0); (DEFAULT applies only when the column is omitted from the INSERT entirely; for explicitly sent NULL values use 12c+ DEFAULT ON NULL: ALTER TABLE my_table MODIFY (my_column DEFAULT ON NULL 0);) If the rule is not truly mandatory, drop the constraint: ALTER TABLE my_table MODIFY (my_column NULL); Validate empty values in the application before sending them.
More from this engine
- library cache lockWait: contention on a library cache object handle (parse/DDL serialization)
- ORA-00604error occurred at recursive SQL level
- ORA-01438value larger than specified precision allowed for this column
- ORA-02291integrity constraint violated - parent key not found
- ORA-02292integrity constraint violated - child record found
- ORA-00979not a GROUP BY expression
- ORA-00918column ambiguously defined