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

Home -> Community -> Usenet -> c.d.o.server -> Re: Foreign Key Deletion problem

Re: Foreign Key Deletion problem

From: Murray Sobol <murray_sobol_at_dbcsmartsoftware.com>
Date: Thu, 13 Oct 2005 16:02:39 -0400
Message-ID: <72ftk1hhrevm2a2p8hs29r8ncvc375h5c9@4ax.com>


On 13 Oct 2005 10:55:10 -0700, jkstill_at_gmail.com wrote:

>Murray Sobol wrote:
>
>> I have tried the following SQL:
>> alter table fin_invoice
>> disable CONSTRAINT fk7_fin_invoice
>> ;
>> which works correctly, but I am looking for a more generic solution:
>> the name of the Foreign Key (i.e. fk7_fin_invoice) may change due to
>> design changes.
>
>Try generating the SQL from all/dba/user_constraints
>
>>
>> I have also tried the following SQL:
>> alter table fin_invoice
>> disable CONSTRAINT all
>> ;
>
>Think about it - do you really want to disable *all* constraints?

	Yes, but only for the duration of the TRUNCATE operation.
	Immediately after that, I would issue a SQL such as:
		alter table fin_invoice
		enable CONSTRAINT all
	if that syntax is available.

>
>> I was hoping to use SQL similar to this for a trigger:
>> alter trigger <name of the trigger> disable/enable
>> ;
>> but have not found anything yet.
>
>Try disable all triggers:
>http://oraclesvca2.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_32a.htm#2075682

        I dont see what value disabling all Triggers would have when dealing with Foreign Key issues. The columns involved in the self-referencing join are popluated by the application, NOT by a trigger.

Murray Received on Thu Oct 13 2005 - 15:02:39 CDT

Original text of this message

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