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: delete a column

Re: delete a column

From: julio <julio.negueruela_at_si.unirioja.es>
Date: 1998/03/12
Message-ID: <350856C9.DED@si.unirioja.es>#1/1

Paul Kreis wrote:
>
 

> I'm new in Oracle and SQL, my question:
> How can I delete one column in a table, and how can I rename a
> columns. I tried it with the alter table statement, but it didn't
> work.

I don't know any way of doing in ORACLE 7.1.7 but you can create a table called f.e. temp, equal to the table to be changed but with the changes you want. Then excute a insert of all rows from the old table to the temp. Drop the old table and recreate as follows:

create table <the same name than before> as select * from temp;

and drop the temp table. This way you reorganize better the space assigned to the table.

Regards.

-- 

Julio Negueruela
DBA    Servicio Inform tico
Universidad de La Rioja      -      Spain
Telf: 941-299179     Fax: 941- 299180
mailto:julio.negueruela_at_si.unirioja.es
Received on Thu Mar 12 1998 - 00:00:00 CST

Original text of this message

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