Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Disable trigger in trigger itself
Thu, Oct 25 2018 10:43 AMPermanent Link

Mike

Hi,

Trigger A on table B is called and runs the statements.

One of the statements updates table B.

Can I disable trigger A before this statement? Will it not stop the current trigger processing?
Thu, Oct 25 2018 11:04 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Mike


Nasty case of recursion you have there.

Look at DISABLE TRIGGERS in the OLH.

Roy Lambert
Thu, Oct 25 2018 11:09 AMPermanent Link

Mike

Hi Roy,

Which information in the online help are you referring to?

Would using a seperate procedure including disabling triggers for these statements be better?
Thu, Oct 25 2018 11:10 AMPermanent Link

Mike

Or moving the statements to a different trigger?
Fri, Oct 26 2018 2:34 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Mike

Either the pdf manual - search for DISABLE TRIGGERS or the help in EDBManager.



Roy Lambert
Fri, Oct 26 2018 2:39 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Mike


Ideally you need to understand why the recursion is there and stomp on it. Recursion is a great tool in a limited number of circumstance but from the very little information provided it seems as though this one will bite you.

Tty mapping the system flow and see if it can be avoided.

Roy Lambert
Sun, Oct 28 2018 12:04 PMPermanent Link

Mike

Thanks Roy.

Will check it out.
Tue, Oct 30 2018 1:22 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mike,

<, Trigger A on table B is called and runs the statements.

One of the statements updates table B.

Can I disable trigger A before this statement? Will it not stop the current trigger processing?
>>

The short answer is yes, but make sure to use a BEGIN..FINALLY block to restore the triggers, or you'll have a problem on your hands.

Also, for performance purposes, if you're doing any querying or calling other procedures/functions in the triggers, look into using the statement/procedure caching in EDB 2.28:

https://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=Buffering_Caching

"Per-Session SQL Statement and Function/Procedure Caching"

https://www.elevatesoft.com/manual?action=viewprop&id=edb2&product=rsdelphiwin32&version=10T&comp=TEDBSession&prop=SQLStmtCacheSize

https://www.elevatesoft.com/manual?action=viewprop&id=edb2&product=rsdelphiwin32&version=10T&comp=TEDBSession&prop=FuncProcCacheSize

These properties can seriously improve performance in such cases (and especially with recursion).

Tim Young
Elevate Software
www.elevatesoft.com
Image