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 Key

Re: Unique Key

From: Juan Carlos <jc_va_at_hotmail.com>
Date: Tue, 27 Jul 1999 20:03:10 -0700
Message-ID: <7nlhd0$dng$1@bgtnsc03.worldnet.att.net>


We run PeopleSoft HR. They don't use PK's or constraints per se to keep their code strictly platform-independent. They enforce PK's with NOT NULL UNIQUE indexes. So they'd be driven out of business if Oracle made a change like that.

Connor McDonald wrote in message <379DBAEF.1898_at_yahoo.com>...
>Lothar Armbrüster wrote:
>>
>> Juan Carlos wrote on 27-Jul-99 23:00:06:
>> >We want to create a xref table for SSN and an Employee ID which will be
>> >different. The table will just be those two columns. But I have a
>> >dilemma. If I make SSN the PK, this would allow duplicate Employee
>> >ID's. If I make it a composite PK, it would be possible to have
>> >duplicate SSN's but different Employee ID's. Is there a way to make
>> >the unique and distinct at the same time without triggers? JerryTWP: el
>> >subject debe ser "Unique Key"
>>
>> Yes, there is a way:
>>
>> 1. Set the PK to SSN
>> 2. Create an additional unique index on Emp ID
>>
>> This should solve your problem.
>>
>> Hope that helps,
>> Lothar
>>
>> --
>> Neue Adresse ab 10.07.'99:
>> Lothar Armbrüster | lothar.armbruester_at_rheingau.netsurf.de
>> Hauptstr. 26 | lothar.armbruester_at_t-online.de
>> D-65346 Eltville |
>
>It would advisable to create a unique constraint as opposed to a unique
>index. I saw some Oracle blurb a while ago that said Oracle may no
>longer support unique indexes as such in the future (although a unique
>constraint is implemented with a unique index anyway!)
>
>HTH
>--
>===========================================
>Connor McDonald
>"These views mine, no-one elses etc etc"
>connor_mcdonald_at_yahoo.com
>
>"Some days you're the pigeon, and some days you're the statue."
Received on Tue Jul 27 1999 - 22:03:10 CDT

Original text of this message

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