Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: drop column
In article <390FF6F4.D2B468EE_at_gre.ac.uk>,
simon cunningham <cs694_at_gre.ac.uk> wrote:
> hello everyone
>
> is it possible to drop a column from a table.....Im sure it is but
cant
> remember the syntax????
>
>
This feature is new to Oracle8i, release 8.1.5 and up.
See http://technet.oracle.com/doc/server.815/a67779/ch4d.htm#64485
for the syntax (alter table T drop column X). You can either drop (and rewrite the table) or just flag delete (set unused) a column which does not rewrite the table.
Prior to that, you would use a view to drop a column:
o rename T to T_tbl, rename the table to something else
o create view T as select <everything but the column to drop> from T_tbl
o revoke all grants on T_tbl
o grant them to T (the new view)
-- Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries http://osi.oracle.com/~tkyte/index.html -- Opinions are mine and do not necessarily reflect those of Oracle Corp Sent via Deja.com http://www.deja.com/ Before you buy.Received on Wed May 03 2000 - 00:00:00 CDT
![]() |
![]() |