ORA-02296: cannot enable – null values found

ORA-02296: cannot enable – null values found

Oracle PL/SQL error message: ORA-02296: cannot enable – null values found.

Cause:

You execute an ALTER TABLE statement with an ENABLE CONSTRAINT clause failed because the table contains NULL values.

Solution:

Set all NULL values in the column to values other than NULL, then re-execute the statement.

Example:

CREATE TABLE TEST3(
ID NUMBER NOT NULL, 
NAME VARCHAR2(250)
) ;
Insert into TEST3 (ID, NAME) values (1,'STRING 1');
Insert into TEST3 (ID, NAME) values (2,'12345');
Insert into TEST3 (ID, NAME) values (3, null);

ALTER TABLE TEST3 MODIFY NAME NOT NULL;

Output:

table TEST3 created.
1 rows inserted.
1 rows inserted.
1 rows inserted.
ORA-02296: cannot enable – null values found