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: Arlette BROSSARD <abray_at_club-internet.fr>
Date: 1999/04/08
Message-ID: <01be820d$e92a45c0$47a224c3@ntdv2113>#1/1

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

Original text of this message

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