Database Administration (MOSC)

MOSC Banner

Not Null constraint are not applied

edited May 17, 2013 12:34PM in Database Administration (MOSC) 3 commentsAnswered ✓
Hi,

Insert into table1 (column1) values (NULL);

 1 row created.

 

The following proves it is NOT NULL:

=========================

Describing the table shows no NOT NULL constraint:

desc table1;

 Name                          Null?    Type

 ----------------------------- -------- --------------------

 column1                      NUMBER(15)


select CONSTRAINT_NAME, search_condition from dba_constraints where table_name = 'table1'

CONSTRAINT_NAME      SEARCH_CONDITION
-------------------- --------------------------------------------------
SYS_C003986          "column1" IS NOT NULL


alter table table1 modify (column1 NOT NULL);
                                                  *
ERROR at line 1:
ORA-01442: column to be modified to NOT NULL is already NOT NULL


The following proves it is  NULL:

=========================

SELECT column_name, nullable
   from dba_tab_columns
   where table_name = 'table1'

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center