| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Unique Constraint with Multiple NULLS
Ouch, you're right. The definition you quoted is for the UNIQUE predicate. I
wrongly thought that the UNIQUE *constraint* was formulated differently but
it is in fact defined in terms of the predicate.
ISO/IEC 9075-2:2003 11.7 says:
3) If <unique column list> UCL is specified, then
...
c) Case:
i) If the <unique specification> specifies PRIMARY KEY, then let SC be the
<search condition>:
UNIQUE ( SELECT UCL FROM TN )
AND
( UCL ) IS NOT NULL
ii) Otherwise, let SC be the <search condition>:
UNIQUE ( SELECT UCL FROM TN )
...
2) The unique constraint is not satisfied if and only if EXISTS ( SELECT * FROM TN WHERE NOT ( SC ) ) is True.
Microsoft SQLServer exhibits the non-standard behaviour that I described and that's the root of the OP's problem - and the root of my confusion since SQLServer is what I work with.
Thanks for the correction.
-- David Portas ------------ Please reply only to the newsgroup --Received on Thu Jan 08 2004 - 05:06:09 CST
![]() |
![]() |