OracleORA-01400

ORA-01400: Cannot Insert NULL into Column

ORA-01400 is raised when an INSERT tries to store NULL in a column that has a NOT NULL constraint. Oracle rejects the statement and no row is inserted.

Example Query

INSERT INTO employees (employee_id) VALUES (NULL);
-- employee_id is defined NOT NULL

Common Causes

  1. 1Required column omitted from INSERT with no DEFAULT value
  2. 2Application passes NULL for a mandatory field
  3. 3Incorrect column mapping in a bulk load

How to Fix It

Always supply a value for NOT NULL columns. Add DEFAULT constraints where a fallback makes sense: column_name VARCHAR2(50) DEFAULT 'Unknown' NOT NULL. Validate source data before bulk inserts.

Need a reliable database?

Try Supabase — free PostgreSQL with a generous free tier. No credit card required.

Get started free →

Got a query causing this error?

Paste it into SQLbuddy and get an instant plain-English explanation with optimization tips.

Analyze My Query →