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: NULLs

Re: NULLs

From: <yong321_at_yahoo.com>
Date: 21 Dec 2005 14:35:18 -0800
Message-ID: <1135204518.391715.197360@g14g2000cwa.googlegroups.com>


That's not a good example. '' is a null or empty string but not NULL. Here's a case (in 9.2.0.7.0) that says two NULLs do not violate the unique constraint:

SQL> create table test (a number);

Table created.

SQL> create unique index unq_test on test (a);

Index created.

SQL> insert into test values (null);

1 row created.

SQL> / 1 row created.

SQL> select count(*) from test where a is null;

  COUNT(*)


         2

There're some anomalies about null. If you insert both a NULL and a null string (i.e. '') into the table, a query WHERE column is NULL selects both of them.

By the way, inside DECODE, NULL can be equal to NULL. See http://groups.google.com/group/comp.databases.oracle.server/msg/e38d8c83cb6f5572

Yong Huang Received on Wed Dec 21 2005 - 16:35:18 CST

Original text of this message

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