Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: delete a column
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.esReceived on Thu Mar 12 1998 - 00:00:00 CST