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: Thu, 21 Oct 2004 11:40:48 -0400
Message-ID: <Jd-dnZTZOc4ARercRVn-gw@comcast.com>

"Frank Piron" <empty_at_zero.nil> wrote in message news:opsf74act8m0et4w_at_news.online.de...
| Am Thu, 21 Oct 2004 09:37:42 -0400 schrieb Mark C. Stock
| <mcstockX_at_Xenquery .com>:
| >
| >
| > did you try a standard UNIQUE constraint on the column?
| >
| > unlike SQL-Server (unless they've changed it since I last worked on it),
| > Oracle processes null values properly in this scenario (i.e., one NULL
| > value
| > is never consider equal to another NULL value)
|
| Yes, but it's a matter of convention because "NULL <> NULL" evaluates
| to null and thus is also not true. So two null values should never
| be considered different.
|
| > ++ mcs
| >
| >
|
| --
| Frank Piron,
| etfrankatkonaddotn
| (leftrotate two)

yes, in theory, the SQL Server approach is more 'pure', but in practice, the Oracle approach is more practical (i'm starting to sound like yogi berra!)

if i'm creating a UNIQUE constraint, my goal is to disallow values that are known to be equal to other known values -- so, it's entirely appropriate to not disallow (sorry for the double-negs) unknown values (triple-negs?) since there is no known basis for excluding them

++ mcs Received on Thu Oct 21 2004 - 10:40:48 CDT

Original text of this message

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