Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Delete column of table in Oracle 8.1.7
Correct with respect to 8.1.7 and accordingly to what I can find goes back to
8.1.5.
For some reason my recollection when I learned it was that you had to set unused before dropping but perhaps it never was as I can't find the reference. The one thing that should be mentioned with respect to dropping columns is the possibility that the column is referenced in a constraint. So it is probably a good habit to get into to use CASCADE CONSTRAINTS unless you want the feedback of a drop column failing when a constraint exists.
It should also be noted that:
You cannot use this clause to drop a pseudocolumn, clustered column, or
partitioning column. (You can drop nonpartitioning columns from a partitioned
table if all the tablespaces where the partitions were created are online and
in read-write mode.) or a column from a nested table, an object table, or a
table owned by SYS.
Daniel Morgan
Alex Ivascu wrote:
> You don't 'have' to set it as UNUSED, right DM?
>
> Alex Ivascu
>
> "Daniel Morgan" <damorgan_at_exesolutions.com> wrote in message
> news:3CBF58CB.D3320F93_at_exesolutions.com...
> > Yes. But before you can:
> >
> > ALTER TABLE table_name DROP COLUMN column_name;
> >
> > You must:
> >
> > ALTER TABLE table_name SET UNUSED column_name;
> >
> > It is a 2 step process.
> >
> > mark it as inactive.
> >
> > Daniel Morgan
> >
> >
> >
> > Franz-Josef Vorspohl wrote:
> >
> > > Hi,
> > >
> > > it is possible to delete a column in Oracle 8.1.7 without create a new
> > > table?
> > >
> > > like this:
> > >
> > > ALTER TABLE tab DROP COLUMN col;
> > >
> > > Regards
> > >
> > > Franz-Josef
> >
Received on Fri Apr 19 2002 - 10:43:53 CDT
![]() |
![]() |