Subject Re: [firebird-support] Re: nulls in unique constraints
Author Ann W. Harrison
Dmitry Yemanov wrote:

>
>> CONSTRAINT UQ_test UNIQUE (a,b,c)
>> INSERT INTO TEST (ID, A, B, C) VALUES (1, 1, 1, NULL);
>> INSERT INTO TEST (ID, A, B, C) VALUES (2, 1, 1, NULL);
>>
>> -- above line violates unique constraint.
>
>... but two sets {1, 1, NULL} and {1, 1, NULL}
> are considered not distinct, so the second insert violate the constraint.
> And this perfectly matches the SQL spec.
>

Sorry, I misread the example - ID is not part of the
constraint, so the 2 in the second insert is irrelevant.


Regards,


Ann