From: buckeye714@my-deja.com
Subject: Re: field deletion
Date: 2000/06/06
Message-ID: <8hjnpc$jgn$1@nnrp1.deja.com>#1/1
References: <8hj6ib$57e$1@nnrp1.deja.com>
X-Http-Proxy: 1.0 x72.deja.com:80 (Squid/1.1.22) for client 170.128.175.145
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Tue Jun 06 20:43:29 2000 GMT
X-MyDeja-Info: XMYDJUIDbuckeye714
Newsgroups: comp.databases.oracle.server
X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; U)


In article <8hj6ib$57e$1@nnrp1.deja.com>,
  christopher.lewis@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.


