Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Not Null constraint

Re: Not Null constraint

From: Vivek sharma <vlsharma_at_hotmail.com>
Date: 6 Jan 2006 06:01:07 -0800
Message-ID: <1136554497.405162.181680@g49g2000cwa.googlegroups.com>

Joel Garry wrote:
> See if user_constraints says dvordtm is the same on both databases.
>
> select status, constraint_name, constraint_type, search_condition from
> user_constraints where table_name = 'DVORDTM
> order by constraint_type, constraint_name';
>
> jg
> --
> @home.com is bogus.
> http://www.heptune.com/farts.html

Hi,

Please check whether this column is a part of Unique or Primary Key Constraint. If it is, then the not null definition will not be copied onto another table. See this :

SQL> desc test_normal

 Name                                      Null?    Type
 ----------------------------------------- --------
----------------------------
 EMPNO                                              NUMBER(10)
 ENAME                                              VARCHAR2(30)
 DEPTNO                                             NUMBER(2)
 SAL                                                NUMBER(10)


SQL> alter table test_normal add constraint pk_test primary key(empno, ename);

Table altered.

SQL> desc test_normal

 Name                                      Null?    Type
 ----------------------------------------- --------
----------------------------
 EMPNO                                     NOT NULL NUMBER(10)
 ENAME                                     NOT NULL VARCHAR2(30)
 DEPTNO                                             NUMBER(2)
 SAL                                                NUMBER(10)

SQL> create table test_vivek as select empno from test_normal where 1=2;

Table created.

SQL> desc test_vivek

 Name                                      Null?    Type
 ----------------------------------------- --------
----------------------------
 EMPNO                                              NUMBER(10)

Regards
Vivek Received on Fri Jan 06 2006 - 08:01:07 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US