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: orace sql query

Re: orace sql query

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 26 Jun 2007 08:23:57 -0700
Message-ID: <1182871437.485877@bubbleator.drizzle.com>


EdStevens wrote:
> On Jun 22, 3:45 pm, DA Morgan <damor..._at_psoug.org> wrote:

>> EdStevens wrote:
>>> On Jun 22, 12:15 pm, sathishkes..._at_gmail.com wrote:
>>>> i want to create table with primary key but with out index
>>> How do you think Oracle enforces the PK?
>> Not with an index. Indexes have nothing to do with primary key
>> enforcement. Consider, for example, a deferred constraint which
>> is built with a non-unique index.
>> --
>> Daniel A. Morgan
>> University of Washington
>> damor..._at_x.washington.edu (replace x with u to respond)
>> Puget Sound Oracle Users Groupwww.psoug.org

>
>
>
> David,
>
> Now I'm really puzzled. My question back to the OP was to suggest to
> him that you can't have a PK without and index (backed up by the
> Concepts Manual stateing "Oracle enforces all PRIMARY KEY constraints
> using indexes.") But after taking me to task on that, you respond
> back to the OP that what he wants is impossible -- exactly what I was
> trying to get the OP to think through and discover for himself. What
> am I missing?

You can not have a primary key or unique constraint without an index. In that you are correct: Oracle won't allow it.

The point I was making was merely a clarification. The index is used to speed the search for values not to enforce the constraint. The description in the manuals/docs is misleading.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Tue Jun 26 2007 - 10:23:57 CDT

Original text of this message

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