Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Delete column(s) from a table

Re: Delete column(s) from a table

From: Allen Kirby <akirby_at_att.com>
Date: 1997/05/06
Message-ID: <336F92E5.7ED0@att.com>#1/1

Patrick C. K. Wu wrote:
>
> Hi all
>
> Could anyone tell me how to delete column(s) from a table using SQL
> statement?

What you would like to do is this: alter table drop column <column>;

Unfortunately, that command doesn't exist. You have to copy the table out to a new table, recreate the old table without the offending column, then copy it back. There are many ways to do this - copy command, create table as select from, etc. But I don't think export/import will work because the import will try to insert into the old column which isn't there anymore.

It's really a hassle so we avoid it by just ignoring the column and not populating it any more. If a convenient time presents itself, we would reorg the table then and get rid of the column. It's up to you as to whether it's worth the trouble or you have the time to do it. from,

-- 
---
Allen Kirby			AT&T ITS Production Services
akirby_at_att.com			Alpharetta, GA.
Received on Tue May 06 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US