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: How to create a uniqueness constraint based on two fields?

Re: How to create a uniqueness constraint based on two fields?

From: Thomas Kellerer <NNGNVRDSJEBN_at_spammotel.com>
Date: Thu, 27 Jan 2005 17:58:45 +0100
Message-ID: <35sku5F4oi3e1U1@individual.net>


On 27.01.2005 17:50 DA Morgan wrote:

>>> While your answer is technically correct there is almost not good
>>> reason for ever creating a unique index in Oracle. Unique indexes,
>>> unlike unique constraints are not as well documented in the data
>>> dictionary and can't be deferred.
>>
>> Interesting, I didn't know that.
>>
>> Could you more be more detailed on what you mean with "can't be
>> deferred"?
>>

[...]
> The basic point being that I can defer validation against the
> constraint. So normally one would have to do this:
>
> INSERT INTO parent
> INSERT INTO child
> COMMIT;
>
> With a deferred constraint I could do it that way or:
>
> INSERT INTO child
> INSERT INTO parent
> COMMIT;
>
> and it would be equally valid. Run the demos and also check out
> the concept docs at tahiti.oracle.com.

Ah. I just didn't make the connection to the "deferrable" option. I do know that possibility but for some reasons I wasn't thinking of that :)

Cheers
Thomas Received on Thu Jan 27 2005 - 10:58:45 CST

Original text of this message

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