Re: how to drop a column in a table?

From: Daniel Murray <dmurray_at_gnncast.net>
Date: Tue, 22 Jun 1999 19:44:52 GMT
Message-ID: <376FE990.22EE96F8_at_gnncast.net>


You also have to be wary of foreign key constraints. If you have any on the table, you will have to disable them or delete them before dropping the original table.

Klaus Sonnenleiter wrote:

> Erin,
>
> Actually, Oracle8i has a DROP COLUMN command. You probably don't want to migrate
> just to be able to drop one column <g>, so your only choice is as Voornaam
> suggested do a
>
> INSERT INTO new_table
> SELECT col1, col2, ... , col[n-1] -- everything but the one you drop
> FROM old_table;
>
> then drop old_table and
>
> RENAME new_table TO old_TABLE;
>
> Hope this helps
>
> Klaus Sonnenleiter
> The Media Machine, LLC
>
> Voornaam Achternaam wrote:
>
> > There is no single command to drop a column. You'd have to unload the date,
> > recreate the table without the column(s) you want to drop and reload the
> > data.
> >
> > Good luck
> >
> > Erin A. O'Neill wrote in message <7jmmor$2i2b$1_at_nnrp9.crl.com>...
> > >I would like to drop just a column in a table. What's the syntax for this?
> > >
> > ...
Received on Tue Jun 22 1999 - 21:44:52 CEST

Original text of this message