Home » RDBMS Server » Server Administration » Where is the 'NOT NULL' constraint held on the system?
Where is the 'NOT NULL' constraint held on the system? [message #168458] Thu, 20 April 2006 09:43 Go to next message
aidi-h
Messages: 45
Registered: November 2005
Member
Does anyone know what table that I can look at to find any 'NOT NULL' contraints on a particular field on a particular table.
'desc' lists my field as nullable i.e. there is no 'NOT NULL' constraint however I would like to see the table where details such as these are stored to make sure. I've checked dba_constraints and all_constraints but cannot see the place where the field is listed.
Re: Where is the 'NOT NULL' constraint held on the system? [message #168460 is a reply to message #168458] Thu, 20 April 2006 09:51 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
SQL> desc dept
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 DEPTNO                                    NOT NULL NUMBER(2)
 DNAME                                     NOT NULL VARCHAR2(14)
 LOC                                                VARCHAR2(13)

SQL> get 1
  1  select a.table_name,b.column_name,a.constraint_name,a.constraint_type from
  2  user_constraints a,user_cons_columns b
  3  where a.constraint_name=b.constraint_name and
  4* b.table_name='DEPT'
SQL> /

TABLE_NAME COLUMN_NAME          CONSTRAINT_NAME                C
---------- -------------------- ------------------------------ -
DEPT       DEPTNO               SYS_C003283                    P
DEPT       DNAME                SYS_C003282                    C

Re: Where is the 'NOT NULL' constraint held on the system? [message #168463 is a reply to message #168458] Thu, 20 April 2006 10:04 Go to previous message
aidi-h
Messages: 45
Registered: November 2005
Member
Thanks for that!!!!! It was very useful. Thanks again
Previous Topic: DATABASE PASSWORD
Next Topic: sizing Undo tablespace
Goto Forum:
  


Current Time: Fri Sep 20 12:40:10 CDT 2024