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: URGENT!!! How can I drop a column???

Re: URGENT!!! How can I drop a column???

From: John Gasch <jgasch_at_erols.com>
Date: 2000/03/31
Message-ID: <38E57F0A.D1164DC@erols.com>#1/1

In pre-O8 you need to recreate the table:

  1. Revoke all grants on table.
  2. Rename the existing table to a new name.
  3. Drop all constraints on the old table.
  4. Drop all indexes on old table.
  5. Create new table without the offending column.
  6. Add constraints, indexes on new table.
  7. Copy data from old table to new table.
  8. Add Grants on new table.

Steps 3 and 4 are necessary to avoid object name collisions because the constraint names will be needed for the new table.

Most folks just nullify the data in the unused column, forget it and avoid the hassle. If you don't want the obsolete column visible to the user, you can hide it behind a view.

G'day

John Gasch


Kari Pannila wrote:
>
> Hi
>
> In Oracle 8.1.5 you can drop a column by command: ALTER TABLE xxx DROP
> COLUMN yyy
> In Oracle versions 8.0 and older, you can't drop a column, without
> recreating the table.
>
> rgdrs Kari
>
> (Mr.) Kari Pannila
> Oracle DBA (OCP)
> TietoEnator Corp - Telecom
>
> Delete X to get a correct mail address ( X is only for the SPAMMERS ).
>
> Steve A wrote:
>
> > But nobody has actually answered the question.
> >
> > steve
> >
> > Billy Verreynne <vslabs_at_onwe.co.za> wrote:
> >
> > > Lesley wrote in message ...
> > > >Wow, you are awfully bitter aren't you.
> > > >I think they were just trying to help.
> > >
> > >
> > > Suggesting the use of VB6 to drop a column in Oracle...? Well such a
> > > suggestion IMHO deserved a sarcastic reply.
  Received on Fri Mar 31 2000 - 00:00:00 CST

Original text of this message

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