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

Home -> Community -> Usenet -> c.d.o.server -> Re: drop column

Re: drop column

From: Valery Yourinsky <vsu_at_softexpress.ru>
Date: Wed, 16 Jun 1999 15:30:27 +0300
Message-ID: <37678a54@mail.softservice.ru>


Michael Ginzburg <gmichael_at_atlas.malamsys.com> wrote in message news:7i93p7$l3h$1_at_news.netvision.net.il...
>Hi!
>
>How to drop column in Oracle? I haven't found such operation in ALTER
TABLE? You can not drop column in Oracle server releases earler then 8.1. If you realy want to do this you must
create new_table
AS
select col_1, col_2, col_4
from old_table
/
then
DROP old_table
/
RENAME new_table TO old_table
/
And then add constraints for this new old_table (renamed from new_table) (if old old_table had such constraints)

In Oracle 8.1 (8i) you can drop column LOGICALLY:

ALTER TABLE killme_tab
SET UNUSED COLUMN col_name
/
-- and then PHISICALLY (if needed):
ALTER TABLE killme_tab
DROP UNUSED COLUMNS
/

or PHISICALLY:

ALTER TABLE killme_tab
DROP COLUMN col_name
/

Valery Yourinsky
---
Softservice, Moscow
ORACLE PARTNER
tel/fax (095) 333-63-10, 128-18-21
http://www.softexpress.ru
ICQ# 368 97 94
second E-mail: vsur_at_usa.net Received on Wed Jun 16 1999 - 07:30:27 CDT

Original text of this message

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