Re: How to delete a column?

From: Sanjay Shastri <sshastri_at_bdm.com>
Date: 1995/11/08
Message-ID: <47quuf$b83_at_news.mcl.bdm.com>#1/1


Robert,

You probably have to ask Oracle why they do not have column delete capability for tables. But here's one ( I think only ) way of accomplishing the task. With the amount of info given, I am making certain assumptions....
Let's say you have a table A : Col1 Number,

                               Col2    Char
and you want to get rid of Col2.

Issue the command: CREATE TABLE TEMP AS SELECT COL1 FROM A;

This makes a copy of table A minus Col2, then drop table A and recreate it as RENAME TEMP TO A...and you are on your way! Note that there are other issues if you have any constraints, grants or referential integrity associated with table A.
Good luck.

  • Sanjay
Received on Wed Nov 08 1995 - 00:00:00 CET

Original text of this message