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: Unique constraint and NULL values

Re: Unique constraint and NULL values

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Fri, 22 Oct 2004 15:54:39 -0400
Message-ID: <VsCdnRYekZkC-OTcRVn-ow@comcast.com>

"Dave" <slimdave_at_yahoo.com> wrote in message news:c502cdfc.0410221123.4e07df91_at_posting.google.com...
| If you want to get around this, then use a function-based index to
| avoid including in a unique index any rows where either of the columns
| is null.

|

| One method would be ...
| [code]
| Create unique index my_ind
| on my_tab (Decode(col2,Null,Null,col1),Decode(col1,Null,Null,col2))
| [/code]

ahh! that appears to nicely trump my pre-FBI solution of using triggers and a shadow table

++ mcs Received on Fri Oct 22 2004 - 14:54:39 CDT

Original text of this message

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