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: PK with no index

Re: PK with no index

From: Pete Sharman <psharman_at_us.oracle.com>
Date: Mon, 19 Jul 1999 14:50:05 -0700
Message-ID: <37939D8D.355F754@us.oracle.com>


The important part is that the index already exists, not that it's named the same. Indeed, this is how sites with naming conventions for objects get create PK indexes. Create the index first, giving it the name you want, then create the PK and it will automatically use an index created on the same columns.

HTH. Pete

Connor McDonald wrote:

> Doug Cowles wrote:
> >
> > How can I base my primary key on an existing index?
> >
> > - Dc.
> >
> > coakleyj_at_hotmail.com wrote:
> >
> > > Hi Doug.
> > > It is likely that the primary key has been disabled.
> > > Disabling will automatically drop the corresponding
> > > index (unless of course you're using Oracle 8 and you
> > > based your primary key on an existing index).
> > > Check the status field in the user_constraints table.
> > >
> > > Cheers
> > > Coakleyj
> > >
> > > In article <37933801.1F97257B_at_bigfoot.com>,
> > > Doug Cowles <dcowles_at_bigfoot.com> wrote:
> > > > Found a primary key constraint on a table, let's say A.
> > > > There are NO indexes on A. No Sys_C0439 blah blah,
> > > > not anything. Checked DBA_INDEXES. Nothing.
> > > > How can a primary key constraint exists on a table with
> > > > no corresponding index of any kind? Has something gone
> > > > kafluoey?
> > > >
> > > > - Dc.
> > > >
> > > >
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Share what you know. Learn what you don't.

>

> I think if oracle finds a unique index on the same columns (in the same
> order, and maybe even the same name?) then oracle will use the existing
> index to create the primary key constraint
>

> 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."

--
Regards

Pete


Received on Mon Jul 19 1999 - 16:50:05 CDT

Original text of this message

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