Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to disable foreign key constraints in a stored procedure?
In article <1142612664.419458.147650_at_p10g2000cwp.googlegroups.com>,
fitzjarrell_at_cox.net says...
> Commens embedded.
> laredotornado_at_zipmail.com wrote:
> > Hi,
> >
> > Is there another way to do what I'm trying to do in Oracle 9i for
> > Solaris? In a stored procedure, I want to disable some foreign key
> > constraints, perform some actions, and then re-enable them.
>
<snip>
> > Your suggestions are apprecaited, - Dave
You would need to use "execute immediate" as has been suggested.
>
> My suggestion would be to re-think your 'reasoning' for disabling the
> foreign keys.
Suppose you want to bulk load data into database - the data is coming from a source where its integrity is guaranteed (because of the constaints there) and you want the quickest load time (perhaps this is a data migration exercise?) - is it not reasonable to want to temporarily disable constraints? Assuming that this is dedicated access for the duration?
-- jeremyReceived on Fri Mar 17 2006 - 11:40:58 CST