Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Primary key
<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.
![]() |
![]() |