Home » SQL & PL/SQL » SQL & PL/SQL » Adding ax extra column to the existing constraint (Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production)
Adding ax extra column to the existing constraint [message #665676] Fri, 15 September 2017 00:55 Go to next message
Revathi.orafaq
Messages: 21
Registered: September 2017
Junior Member

Hi All,

Is there any direct way to add on extra column to the existing constraint.
As of now we are drooping the existing one,and adding one more with the same name , required columns.


DROP TABLE MY_TABLE1;
CREATE TABLE MY_TABLE1
  (ID INT CONSTRAINT PK  PRIMARY KEY  ,a INT
  );
ALTER TABLE MY_TABLE1  DROP CONSTRAINT PK;
ALTER TABLE MY_TABLE1  ADD CONSTRAINT PK PRIMARY KEY(ID ,a );
  
Is it possible to achieve the same with in single statement ?

Thanks
Revathi.T
Re: Adding ax extra column to the existing constraint [message #665680 is a reply to message #665676] Fri, 15 September 2017 03:43 Go to previous messageGo to next message
Littlefoot
Messages: 21266
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Not possible, as far as I can tell. That would be ALTER TABLE MODIFY CONSTRAINT, but - it doesn't exist. So, yes - you'd have to drop it first and then create an new one.
Re: Adding ax extra column to the existing constraint [message #665681 is a reply to message #665680] Fri, 15 September 2017 03:54 Go to previous message
Revathi.orafaq
Messages: 21
Registered: September 2017
Junior Member

Thanks a lot for your response .
Previous Topic: wirting automatically multi files by utl_file.fopen
Next Topic: Large volume data compare - NEED HELP
Goto Forum:
  


Current Time: Thu Dec 14 07:56:24 CST 2017

Total time taken to generate the page: 0.02761 seconds