Re: orace sql query



On Jun 22, 3:45 pm, DA Morgan <damor...@xxxxxxxxx> wrote:
EdStevens wrote:
On Jun 22, 12:15 pm, sathishkes...@xxxxxxxxx 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...@xxxxxxxxxxxxxxxx (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

.



Relevant Pages

  • Re: Need unique constraint on data table
    ... >click on the table and select design table and then right click on the design ... Like a PRIMARY KEY constraint, a UNIQUE constraint may span several ... Enterprise Manager is a great tool for administrating the database (doing ...
    (microsoft.public.sqlserver.setup)
  • Strange error with Oracle 10g XE
    ... The following SQL statements run successfully on Oracle 9i, ... primary key constraint that is different from the old one.) ... -- drop the old primary key constraint as it would be violated by the ...
    (comp.databases.oracle.misc)
  • Re: Primary key question
    ... Oracle newbie trying to adjust to the differences in the two implementations. ... primary key ); ... CREATE TABLE ABC( ... let's add the primary key constraint: ...
    (comp.databases.oracle.server)
  • Re: Primary key question
    ... Oracle newbie trying to adjust to the differences in the two implementations. ... Create a basic table without a primary key: ... CREATE TABLE ABC( ... let's add the primary key constraint: ...
    (comp.databases.oracle.server)
  • Re: Unique and non unique index
    ... If you want to enforce a primary key constraint, create a primary key for the table. ... If you need an index for performance reasons, create a non-unique index. ...
    (comp.databases.oracle.misc)