Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: field deletion
In article <8hjbdg$99k$1_at_nnrp1.deja.com>,
ddf_dba_at_my-deja.com wrote:
> In article <8hj6ib$57e$1_at_nnrp1.deja.com>,
> christopher.lewis_at_ac.com wrote:
> > Hi all, what is the syntax for removing a field (and any
constraints)
> > from a table during an alter table? Thanks!
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> Christopher,
>
> I'm sorry, but you cannot drop a column or a constraint from a table
> even with the alter table command. The only way to accomplish this is
> to re-create the table without the column or the constraint in the
> specification. You can disable constraints on a table but you cannot
> drop the constraint without dropping the table.
>
> David Fitzjarrell
> Oracle DBA
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Christopher,
Before I get lambasted for my remarks let me modify them a bit and say that you CAN drop a constraint from a table with the alter table command, however you CANNOT drop a column (or field, if you prefer) by using alter table. The syntax to drop a constraint is:
alter table <tablename> drop constraint <contraint_name>;
This will drop the constraint from the table. Sorry for the "brain fart" on this, but it happens sometimes.
David Fitzjarrell
Oracle DBA
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Jun 06 2000 - 00:00:00 CDT