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: How to delete a column from a table?

Re: How to delete a column from a table?

From: Steve Phelan <stevep_at_pmcgettigan.demon.co.uk>
Date: 1997/03/11
Message-ID: <33252A4F.3700@pmcgettigan.demon.co.uk>#1/1

Andy Hardy wrote:
>
> In article <33240BD1.CDF_at_pmcgettigan.demon.co.uk>, Steve Phelan
> <stevep_at_pmcgettigan.demon.co.uk> writes
> >Connor McDonald wrote:
> >>
> >> Simon Goland wrote:
> >> >
> >> > Yes, I know, I have seen it here sometime ago. But it was "then", and I
> >> > thought I won't need it... but now I do... ;-)
> >> >
> >> > So my long and tedious approach so far is:
> >> >
> >> > --
> >> > [ Simon Goland B-)> sg_at_mda.ca ]
> >> > [ Without action there is no change ]
> >>
> >> Cheap and easy way...but not really doing the drop...
> >>
> >> rename table xxx to xxx_gone
> >> create view xxx as select (* minus missing column) from xxx_gone...
> >>
> >> Voila ! (Ugh...)
> >>
> >> Cheers
> >> --
> >> Connor McDonald
> >> Systems Administrator-Unix/Oracle
> >> BHP Iron Ore
> >> "You're not drunk if you can lie on the floor without holding on"
> >> - Dean Martin
> >Shouldn't this read:
> >
> > rename table xxx to xxx_gone
> > create table xxx as select (* minus missing column) from xxx_gone...
> >
> >That is, the second line should be creating a table, not a view on the
> >old table you want to get rid of?
> >
> >Steve Phelan.
>
> By creating a view he saves having to recreate the indexes, constraints,
> etc.
>
> Andy Hardy. PGP key available on request
> ===============================================================
> Grosch's Law
> Computing power increases as the square of the cost.

True, but would you want a view hanging around your database to make a table look different when what you really wanted to do was get rid of a column in the table in the first place? (And Inserts would always have to refer to the column if it was declared as NOT NULL when the table was created). The view just seemed to be a very messy way of not reaching the desired goal, IMHO.

Steve Phelan. Received on Tue Mar 11 1997 - 00:00:00 CST

Original text of this message

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