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: L120bj <l120bj_at_aol.com>
Date: 29 Jun 1998 22:24:46 GMT
Message-ID: <1998062922244600.SAA18012@ladder03.news.aol.com>


>Subject: Index as primary key?
>From: rbook_at_my-dejanews.com
>Date: 6/29/98 11:06 GMT
>Message-id: <6n7sgc$mtf$1_at_nnrp1.dejanews.com>
>
>Hi!
>
>For building the primary key in an dimension table i decided to
>use an own generated index.
>Can i use an index as primary key in ORACLE7?
>How should i do?
>It is better to generate an artifical primary key?
>
>Thank you!
>Ralf

Hi Ralf,
  Yes you can use the index you have built as the primary key. Simply issue the following statement :-
alter table your_table
add constraint your_index
primary key (your_index_columns);

Oracle is intelligent (?!) enough to use the existing index since it's name and definition is the same as that for the primary key. HTH,
  Rob Received on Mon Jun 29 1998 - 17:24:46 CDT

Original text of this message

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