GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL Plus
Go To First  |  Previous Question  |  Next Question 
 SQL Plus  |  Question 52 of 132    Print  
How to drop the column in a table

  
Total Answers and Comments: 6 Last Update: March 23, 2009   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 27, 2005 17:56:39   #1  
Satyavani        

RE: How to drop the column in a table
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.

 
Is this answer useful? Yes | No
March 16, 2006 23:52:48   #2  
Sundar_oracle Member Since: March 2006   Contribution: 1    

RE: How to drop the column in a table

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


 
Is this answer useful? Yes | No
July 24, 2006 05:36:32   #3  
Shiv Mangal Rahi        

RE: How to drop the column in a table

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.


 
Is this answer useful? Yes | No
December 07, 2006 07:50:22   #4  
rampratap409 Member Since: September 2006   Contribution: 111    

RE: How to drop the column in a table

If your oracle version is 9i or above then only you can drop a column.

alter table <tablename> drop column < columnname>;


 
Is this answer useful? Yes | No
December 12, 2006 04:35:14   #5  
NARENDRA        

RE: How to drop the column in a table

Alter table TABLENAME drop column COLUMNNAME

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


 
Is this answer useful? Yes | No
March 23, 2009 06:10:05   #6  
sharmasl Member Since: March 2009   Contribution: 10    

RE: How to drop the column in a table

use the following syntex for drop the column


alter table emp drop column ename;

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape