Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Index as primary key?
>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