Re: Can we remove a column from a table??

From: Paul Dorsey <pdorsey_at_dulcian.com>
Date: 2000/01/31
Message-ID: <vifl4.12313$t_.268951_at_news.rdc1.nj.home.com>#1/1


If you are not on 8.1.5, you can't just

RENAME old_name to new_name;
CREATE TABLE old_name AS SELECT col1, col2 FROM new_name; DROP new_name;

Mak sure you recreate all your constraints (PK,FK,check), indexes and storage parameters.

--
Paul Dorsey
Dulcian, Inc.
(212) 595-7223
web address: http://www.dulcian.com
email: pdorsey_at_dulcian.com


<pberetta_at_my-deja.com> wrote in message news:873re0$bdb$1_at_nnrp1.deja.com...

> Peter,
> Unless you are using Oracle 8i, you cannot remove a column from a
> table. What you must do is something like this:
>
> RENAME old_name to new_name;
> CREATE TABLE old_name AS SELECT col1, col2 FROM new_name;
> DROP new_name;
>
> Not quite as simple as an ALTER TABLE, but it gets the job done.
> Regards,
> Paul
>
>
> In article <38952DF3.9B9654EC_at_hmc.com.tw>,
> peter <misybh_at_hmc.com.tw> wrote:
> > hi..
> > I have a table named 'test' which has 3 columns..
> > Can I remove one column????
> >
> > we all know that we can use SQL command to alter a table
> > but it seems that we only add or modify a column ..
> > How can we remove a column from a table???
> >
> >
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Mon Jan 31 2000 - 00:00:00 CET

Original text of this message