Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Primary key
Sorry, I made a mistake with the keyboard !
Below, my answer completed.
If there is no primary key :
ALTER TABLE mytable
ADD CONSTRAINT pk_mytable
PRIMARY KEY (cola,colb)
USING INDEX TABLESPACE mytablespace STORAGE ( ... );
If there is a previous primary key and you want add a column :
1°)
ALTER TABLE mytable
DROP CONSTRAINT pk_mytable;
2°)
ALTER TABLE mytable
ADD CONSTRAINT pk_mytable
PRIMARY KEY (cola,colb,colc)
USING INDEX TABLESPACE mytablespace STORAGE ( ... );
tyann001_at_aol.com a écrit dans l'article <370CB115.350A8F9_at_aol.com>...
> Anyone know how to add a primary key to a column on an existing table?
>
Received on Thu Apr 08 1999 - 00:00:00 CDT