Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DROP a column

Status
Not open for further replies.

DCCoolBreeze

Programmer
Jul 25, 2001
208
US
How can I drop a column from a table? I tried ALTER TABLE table_name DROP COLUMN( field_name ); and got an error of "Invalid Column Name"
 
Cool,

Try this set of syntax:

alter table <tablename> set unused column <colname>;
alter table <tablename> drop unused columns;

Dave
Sandy, Utah, USA @ 18:38 GMT, 11:38 Mountain Time
 
set getting invalid column name. now if get it on the alter table <> set unused column <>. The column does exist
 
Cool,

Could you please post a &quot;describe&quot; of the table followed by a literal copy-and-paste of your attempt to execute the &quot;ALTER TABLE...&quot; commands you are using?

The commands should work in all Oracle versions 8i and beyond.

Thanks,

Dave
Sandy, Utah, USA @ 19:29 GMT, 12:29 Mountain Time
 
btw, the following works as well:
alter table <tablename> drop column <colname>

Cheers,
Dan
 
I suppose that column name may be in lower or mixed case. In this case you should &quot;doublequote&quot; it.

Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top