MetricSign
Start free
High severitydata

Oracle Database Error:
ORA-01400

What does this error mean?

An INSERT or UPDATE statement attempted to set a NOT NULL column to NULL, violating the column's constraint.

Common causes

  • 1Source data contains NULL values for a column that is NOT NULL in Oracle
  • 2ADF column mapping omits a required column, which Oracle treats as NULL
  • 3A new NOT NULL column was added to the target table after the pipeline was built
  • 4DEFAULT value is not defined on the column and the source does not provide a value

How to fix it

  1. 1Step 1: Identify the column from the error message: `SELECT column_name, nullable FROM all_tab_columns WHERE table_name = '<TABLE>' AND nullable = 'N';`.
  2. 2Step 2: Add a NVL or COALESCE in the source query to substitute a default value: `NVL(source_col, 'DEFAULT')`.
  3. 3Step 3: Define a DEFAULT constraint on the Oracle column so omitted values get a default automatically.
  4. 4Step 4: Fix the data in the source system if the NULL is a data quality issue.
  5. 5Step 5: Update the ADF column mapping to include the required column.

Example log output

ORA-01400: cannot insert NULL into ("SCHEMA"."ORDERS"."CUSTOMER_ID")

Frequently asked questions

How do I find which column is NULL?

The error message includes the column name in parentheses, e.g. ORA-01400: cannot insert NULL into (SCHEMA.TABLE.COLUMN_NAME).

Source · docs.oracle.com/error-help/db/ora-01400

Other data errors