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