Click to See Complete Forum and Search --> : Drop Column


mejaz
July 5th, 2005, 01:39 PM
How can i drop a column from oracle table?

I m using the following statement.

Alter table Table_Name drop column column_name;


But this statement does not work at all and it generate an error.


Thanks in advance

olivthill
July 6th, 2005, 04:32 PM
What error message do you get?

If the message is about the syntax, you might try one of these:

alter table tb_one drop column (col_two);
alter table tb_one drop col_two;
alter table tb_one drop (col_two);

If the message is about priviledges you have to grant them beforehand.

If the message is about constraints violation, you have to remove the index referencing the column, or use the additional keywords "cascade constraints", e.g.:

alter table tb_one drop column col_two cascade constraints;