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: <paul.schluck_at_pi.net>
Date: 1998/03/12
Message-ID: <3508433a.3601761@news.pi.net>#1/1

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. Received on Thu Mar 12 1998 - 00:00:00 CST

Original text of this message

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