How to drop the column in a table

Showing Answers 1 - 12 of 12 Answers

Satyavani

  • Jul 27th, 2005
 

There are 2 ways of doing it : 
alter table"table name" drop column "column name"; 
 
This drops the column immediately. However if there is huge data and you would like to postpone the task of dropping the columns you can make the columns unused and drop the unused columns during the weekend or less peak activity time. 

  Was this answer useful?  Yes

Hi,

I could not find the way to drop a column as said, will u send which is the  version to work with the same.

Regards,

K. Sundar.

djsundar@rediffmail.com

  Was this answer useful?  Yes

Shiv Mangal Rahi

  • Jul 24th, 2006
 

Hi All,

You could drop column of a table by follwing command. And it works with all the version of oracle.

SQL> Alter table <table name> drop column <column name>;

How ever instead of dropping a column you could make it unused. And at the end of month or week you could drop all the unused columns. This is due to avoid some risks.

To make a column unused you could have following command:

SQL> Alter table <table name> set unused column <column name>;

To drop unused columns you could use the following command:

SQL> Alter table <table name> drop unused columns;

You could also drop all the unused columns of a schema as well.

  Was this answer useful?  Yes

NARENDRA

  • Dec 12th, 2006
 

Alter table TABLENAME drop column COLUMNNAME

Generally rollback cant be followed are implemented along with these DDL statements. The commit statement automatically involves.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions