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

Home -> Community -> Usenet -> c.d.o.server -> Re: field deletion

Re: field deletion

From: <buckeye714_at_my-deja.com>
Date: 2000/06/06
Message-ID: <8hjnpc$jgn$1@nnrp1.deja.com>#1/1

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.
>

I know from at least 8.1.5 on, you can use the following command:

ALTER TABLE <tablename> DROP COLUMN <column_name> CASCADE CONSTRAINTS;

You must use the CASCADE CONSTRAINTS clause if the column being dropped is referenced by columns in another table or any remaining columns in the target table. The statement will fail if it should be included and is not. There are other optional clauses available, but this sounds like it will do what you want.

HTH,
Patrick

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Jun 06 2000 - 00:00:00 CDT

Original text of this message

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