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: <fitzjarrell_at_cox.net>
Date: Fri, 22 Jun 2007 14:50:07 -0700
Message-ID: <1182549007.018985.321540@g37g2000prf.googlegroups.com>


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

>From the documentation:

"Oracle enforces all PRIMARY KEY constraints using indexes. In Figure 21-5, the primary key constraint created for the deptno column is enforced by the implicit creation of:

A unique index on that column

A NOT NULL constraint for that column

Composite primary key constraints are limited to 32 columns, which is the same limitation imposed on composite indexes. The name of the index is the same as the name of the constraint. Also, you can specify the storage options for the index by including the ENABLE clause in the CREATE TABLE or ALTER TABLE statement used to create the constraint. If a usable index exists when a primary key constraint is created, then the primary key constraint uses that index rather than implicitly creating a new one."

According to Oracle it does.

David Fitzjarrell Received on Fri Jun 22 2007 - 16:50:07 CDT

Original text of this message

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