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: Attribute Level Constraint

Re: Attribute Level Constraint

From: Khurram <oraware_at_gmail.com>
Date: 23 Jun 2006 07:58:51 -0700
Message-ID: <1151074731.778824.62560@u72g2000cwu.googlegroups.com>


hi

Thanx Anurag

Anurag Varma wrote:
> mytype(null,null) would result in a pointer to be placed in the table column Name
> which would point to this (null,null) row. That is not the same as putting a null value
>in the column.

You mean to say column (NAME) would reference to MYTYPE OBJECT then why at the time of inserting NULL value it validates to column (NAME's) constraint why not the reference let it bypass?

SQL> CREATE TABLE t (id NUMBER,name MYTYPE);

Table created.

SQL> ALTER TABLE t MODIFY (name CONSTRAINT t_name_nn NOT NULL);

Table altered.

SQL> INSERT INTO t VALUES (1,NULL);
INSERT INTO t VALUES (1,NULL)
*
ERROR at line 1:
ORA-01400: cannot insert NULL into ("SCOTT"."T"."NAME")

But in case of LOB column it must be made non-null,that is,it must contain a locator,for
that obligation empty_lob() is used but its not the same case with my scenario ,Perhaps
i can acheive it by defining attribute level constraint ,but why?  

Thanx Anurag Received on Fri Jun 23 2006 - 09:58:51 CDT

Original text of this message

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