Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Delete a column from a table ?

Re: Delete a column from a table ?

From: Matthias Gresz <GreMa_at_t-online.de>
Date: 1998/03/13
Message-ID: <6eamr5$deo$4@news01.btx.dtag.de>#1/1

On Thu, 12 Mar 1998 20:27:16 GMT, paul.schluck_at_pi.net wrote: Hi,

all FK's, other contstraints and triggers must be rebuilt.

>On Thu, 12 Mar 1998 15:57:53 +0100, "Marco Nedermeijer"
><m.n.nedermeijer_at_rtd.nl> wrote:
>
>>This may sound stupid, but how can a delete a column from a table ?
>>
>>Thanks,
>>
>>Marco Nedermeijer
>>m.n.nedermeijer_at_rtd.nl
>>
>>
>
>You can't. There is no SQL DDL statement for this action. What you can
>do to achieve the same result is the following:
>
>Say your original table looks like this:
>create table A
>(a varchar2(5)
>,b number
>,c date
>)
>and you want to get rid of column c
>
>rename table A to org_A
>;
>
>create table A as
>select a,b from org_A
>;
>
>et voila, you have a table A with the structure you wanted.
>There is however one thing to keep in mind: after doing this you have
>to re-issue all the grants for table A. When renaming a table the
>grants go with it.
>
>I hope this works for you.
>
>
>

--

Regards

Matthias Gresz    :-)

GreMa_at_T-online.de
Received on Fri Mar 13 1998 - 00:00:00 CST

Original text of this message

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