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 delete constraints?

Re: how to delete constraints?

From: <moerkd_at_my-deja.com>
Date: Fri, 28 Jan 2000 07:45:32 GMT
Message-ID: <86rhet$lns$1@nnrp1.deja.com>


In article <86qkba$1mb$1_at_nnrp1.deja.com>,   Otis Gospodnetic <otis_at_my-deja.com> wrote:
> Hi,
>
> How does one go about deleting/droping constraints?
>
> delete from user_constrains where owner = 'MYUSER'
>
> Like that maybe? (I don't want to just do it and mess it up :))
>
> Thanks,
>
> Otis
>

Hi Otis,

Usually Constraints are made on atable or a table row. To drop a constraint you need the table_name on which the constraint is based. There are also differences on dropping the different Constraint types.

If it is an column constraint (not null) you'll have to use alter table <table_name> modify (<Column_name> null);

If it is an check_constraint or a Foreign Key use alter table <table_name> drop constraint <constraint_name>;

I don't know exactly what happens if you manipulate the Data Dictionary as you showed above. But I think it is better to use the alter table command.

Hope that helps

Detlev

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Jan 28 2000 - 01:45:32 CST

Original text of this message

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