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 06:48:08 -0700
Message-ID: <1151070488.948427.132570@g10g2000cwb.googlegroups.com>

Thanx andrew for yours coperation

> There is a subtle but real difference between NULL and mytype(NULL,NULL).??

Please would you tell me whats the diffrence between NULL and mytype (NULL,NULL)?? SQL> CREATE TYPE mytype AS OBJECT
  2 (fname VARCHAR2(10),
  3 lname VARCHAR2(10))
  4 .
SQL> / Type created.

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")

SQL> INSERT INTO t VALUES (1,mytype(NULL,NULL));

1 row created.

I am still confused why it let go (NULL,NULL) value while the attributes are masked by NOT NULL at the time of table creation?

Khurram Received on Fri Jun 23 2006 - 08:48:08 CDT

Original text of this message

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