Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

alter table drop column

goodluck247Dec 9 2014 — edited Dec 10 2014

Hello everyone,

I am creating a simple table like this:

create table x(a number, b varchar2(20));

alter table x modify a constraint a_pk primary key;

insert into x values(1, 'first row');

insert into x values(2, 'second row');

commit;

Then:

SQL> select * from x;

         A B

---------- --------------------

         1 first row

         2 second row

Then I run these commands:

SQL> alter table x drop column a;

Table altered.

SQL> select * from x;

B

--------------------

first row

second row

Question: why am I able to drop this column when it is a PRIMARY KEY for the table? I am not using the CASCADE CONSTRAINT keywords with the DROP COLUMN clause...

This post has been answered by unknown-7404 on Dec 9 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 7 2015
Added on Dec 9 2014
8 comments
8,143 views