Wednesday, September 19, 2007

modify inline constraint

ods01@/software/oraods/product/10.2.0/bin> ./oerr ora 1451
01451, 00000, "column to be modified to NULL cannot be modified to NULL"
// *Cause: the column may already allow NULL values, the NOT NULL constraint
// is part of a primary key or check constraint.
// *Action: if a primary key or check constraint is enforcing the NOT NULL
// constraint, then drop that constraint.

This problem occurred during a database migration.
Failed statement is "alter table test_table modify colname NULL;". Developer told me was working.

Did a "desc test_table"
The column of "NULL?" is blank, which usually means NULLable.
However, check dba_constraints, it shown column not null and enabled.


This is discrepancy caused by my migration steps" alter table modify constraint enable NOVALIDATE;"


After I issue " alter table modify constraint enable;" again. The DESC tallys with dba_constraint, i.e. show me NOT NULL.

Subsequently, the failed job went through.