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: Index as primary key

Re: Index as primary key

From: Mark Powell <Mark.Powell_at_eds.com>
Date: 29 Jun 1998 15:13:59 GMT
Message-ID: <01bda370$663bc660$a12c6394@J00679271.ddc.eds.com>


If I understand you correctly, the answer to your question is that Oracle uses a unique index with all indexed columns in it being declared 'not null' to enforce a primary key constraint. You can build the index first and alter the table to add the primary key constraint (which will find and use the existing unique index on the same columns) or you can build the index with the constraint clause.

See the SQL Manual sections: constraint clause and alter table

rbook_at_my-dejanews.com wrote in article <6n7sao$mnv$1_at_nnrp1.dejanews.com>...
> Hi!
>
> For building an primary in an dimension table i decided to
> use an own generated index.
> Can i use in ORACLE7 an index as primary key?
> How should i do?
> It is better to generate an artifical primary key?
>
> Thank you!
> Ralf
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
>
Received on Mon Jun 29 1998 - 10:13:59 CDT

Original text of this message

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