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

Home -> Community -> Usenet -> c.d.o.tools -> Re: disabling foreign keys

Re: disabling foreign keys

From: Spencer <spencerp_at_swbell.net>
Date: Wed, 30 May 2001 21:09:33 -0500
Message-ID: <QHhR6.142$fw1.193959@nnrp2.sbc.net>

"Peter Morris" <no_spam.ple_at_se.com> wrote in message news:9f2nlp$bc8$1_at_lyonesse.netcom.net.uk...
> I want to write a script that disables all foreign keys at once.
> I have tried the following
>
> update
> user_constraints
> set
> status = 'DISABLED'
> where
> constraint_name like 'ITX%FK_' ;
>

this is a bad idea.

>
> (all foreign key names follow a regular pattern)
> This produces an error message : insufficient privileges.
>

lucky for you that oracle gave you an error message, rather than trashing your dictionary.

> I think the problem is that I have insufficient priveliges set
> to do this. Our sysadmin says that it can't be done at all.
> Is he right? If so, is there any other way of doing it?
>

if your sysadmin means not updating the dictionary views, then, yes he is right. just take a look at the view text (source) for user_constraints.

alter table mytable_name disable constraint myconstraint_name ; Received on Wed May 30 2001 - 21:09:33 CDT

Original text of this message

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