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

Home -> Community -> Usenet -> c.d.o.misc -> Re: how to modify a CHECK column-constrait ?

Re: how to modify a CHECK column-constrait ?

From: Ruud Schmeitz <R.Schmeitz_at_MEMIC.UNIMAAS.NL>
Date: Sat, 24 Jul 1999 08:51:13 +0200
Message-ID: <7nbnp3$5h$1@rl0001.unimaas.nl>


Brian Peasland wrote in message ...
>
>1. To modify an existing CHECK constraint, it's as easy as dropping the
>constraint and then altering the table to include the new CHECK constraint
>you'd like. True, you can't modify the constraint directly,but this other
>method isn't that difficult.
>
>2. Dropping a column from a table is something everyone wishes to be
>possible. Apparently Oracle is listening since this feature is available
>with Oracle 8i (8.1.5). But once again, there is a workaround. This one
>takes a little more effort. Assuming table 1 has columns col1, col2, col3,
>you can do one of two things:
> a) copy the table to a temp table: CREATE table1_copy AS SELECT * FROM
>table1. Then drop the table: DROP TABLE table1. Then recreate the new table
>without col2: CREATE TABLE table1 AS SELECT col1, col3 FROM table1_copy. Now
>drop the temp table: DROP TABEL table1_copy.
>
> Or
>
> b) Just create a view that only has the two columns: CREATE VIEW
>table1_view AS SELECT col1,col3 FROM table1.
>
>Hope that helps,
>Brian Peasland
>peasland_at_msn.com

Yes it did help.

Thanks !!


"Live Long and Prosper" - Spock
"And let Wisdom be your Guide" - Spock's brother

Ruud Schmeitz
Universiteit Maastricht Received on Sat Jul 24 1999 - 01:51:13 CDT

Original text of this message

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