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: diff. between Primary-Key and unique index

Re: diff. between Primary-Key and unique index

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Fri, 21 Jan 2000 18:22:31 +0800
Message-ID: <38883367.2C1A@yahoo.com>


Bob Bain wrote:
>
> Actually, the only real difference between a Primary Key and a Unique Index
> is that a Unique index will allow NULL values whereas a primary key won't.
> If you notice when you create the primary key ORACLE automatically creates a
> unique index using the keys specified in the PRIMARY KEY command.
>
> From 8.1.5 onwards you can base a PRIMARY KEY on a unique index that you
> have already built, therefore allowing NULL values in a PRIMARY KEY!!
>
> Where is it documented that unique indexes shouldn't be used anymore, or is
> this just an Urban Legend that's floating around??
>
> Emmanuel HUMBLOT <e_humblot_at_wanadoo.fr> wrote in message
> news:01bf63fc$2684a980$3601017e_at_EHM.cirra.fr...
> > A unique index created directly with a "create unique index" command is an
> > old-fashioned way to code integrity constraints.
> >
> > It exists for compatibility purposes with older versions of Oracle, but it
> > shouldn't be use anymore for new databases.
> >
> > --
> > Regards
> >
> > Emmanuel HUMBLOT e_humblot_at_wanadoo.fr
> >
> > Andreas Michler <Andreas.Michler_at_adicom.de> a écrit dans l'article
> > <388819AE.547713F0_at_adicom.de>...
> > > Can anyone tell me the differences between a table with primary key
> > > and
> > > a table with no primary key, but a unique index on some fields
> > > ????????
> > >
> > >
> > >
> > > -------------------------------------
> > > ADICOM Informatik GmbH
> > > Andreas Michler
> > > Wiesfleckenstr. 34
> > > 72336 Balingen
> > > Tel: 07433/9977-57,Fax: -90
> > > E-Mail: Andreas.Michler_at_adicom.de
> > > http:\\www.adicom.de
> > > -------------------------------------
> > >
> > >
> > >

I think unique constraints have 'obsoleted' unique indexes.

--



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 Fri Jan 21 2000 - 04:22:31 CST

Original text of this message

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