Re: dropping a column

From: Maciej Matysiak <matys_at_cs.put.poznan.pl>
Date: 1997/07/22
Message-ID: <33D4A638.99D4C43F_at_cs.put.poznan.pl>#1/1


Ceri Moran wrote:

> ...
> I have two columns in the middle of a table, I wish to move to the
> end, I cant seem to reorder using the Navigator or SQLPLUS.
> I have tried removing and adding them in, but cant seem to find the
> correct SQL to allow me to do this.
> Please could you advise me the correct SQL for dropping a non-key
> column from a table?

You must create a new table without the columns that you want to remove and copy data from the old table to the new one. So, you need two statements: 1. create table "NEW".... select ... from "OLD" 2. drop table "OLD"
If there are constraints that refer to "OLD" then you have to drop them and create once again or disable them and enable after creation of "NEW". BTW, I don't understand why Oracle doesn't support removing or even changing names of columns in 'alter table'.

Maciej Matysiak Received on Tue Jul 22 1997 - 00:00:00 CEST

Original text of this message