Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Primary key

Re: Primary key

From: Jérôme Texier <jtexier_at_ystel.fr>
Date: 1999/04/08
Message-ID: <7eikft$k7t$1@jaydee.iway.fr>#1/1

<tyann001_at_aol.com> a écrit dans le message : 370CB115.350A8F9_at_aol.com...
> Anyone know how to add a primary key to a column on an existing table?

First, verify that your future PK is NOT NULL.

After, try :

create unique index <index_pk> on <my_table> (<column_pk);

alter table txrj add constraint <constraint_pk> primary key (<column_pk>);

If you don't create a index before, it will be created with the name of the constraint.



Jérôme
jt_at_ystel.fr
Received on Thu Apr 08 1999 - 00:00:00 CDT

Original text of this message

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