Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Dave Baligo (12.10.FC9W1 on Solaris) asked how to force the firing order of multiple insert triggers. Art Kagel guessed creation order but suggested testing. Fernando Nunes said the order is undetermined and must not be relied on; put the actions in one stored procedure called from a trigger. Everett Mills agreed to consolidate. Dave thanked everyone.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Dave Baligo — source: IBM Community (ConnectedCommunity.org) Informix forum
Hi,
We are running Informix 12.10.FC9W1 on Solaris. We have multiple insert triggers on a table. Is there a way to enforce that the triggers should get executed in a particular order?
Thank You,
--Dave
------------------------------
Dave Baligo
------------------------------
#Informix
↪ replying to Dave Baligo
Art Kagel — source: IBM Community (ConnectedCommunity.org) Informix forum
I've never testing this, but I strongly suspect that triggers are fired in the order they are created, ie they are selected from systriggers ORDER BY trigid ...
Easy enough to test. Create two update triggers on different column on a table that write to a logging table that has a serial column so that the record written identifies which trigger it was that wrote it. Then try adding the two triggers in different orders and see what happens.
------------------------------
Art Kagel
------------------------------
↪ replying to Art Kagel
Fernando Nunes — source: IBM Community (ConnectedCommunity.org) Informix forum
The order of the execution is undetermined. You can find what it is today, but that doesn't mean it won't change in the future. Customers cannot assume any specific order.
If you have a set of actions you want to execute than create a stored procedure and execute it on a trigger.
There is not reasonable rationale to assume a certain order on independent triggers.
If the actions are dependent then they should be executed together.
Regards.
------------------------------
FERNANDO NUNES
------------------------------
↪ replying to Fernando Nunes
Art Kagel — source: IBM Community (ConnectedCommunity.org) Informix forum
Excellent point Fernando!
------------------------------
Art Kagel
------------------------------
↪ replying to Dave Baligo
Everett E Mills — source: IBM Community (ConnectedCommunity.org) Informix forum
I would consolidate them down to one trigger/trigger and stored procedure that does the steps you want in the correct order.
I think the original post is included. I'm posting from the website and it's kind of hazy as to what happens when you do that.
--EEM
------------------------------
Everett E Mills
------------------------------
↪ replying to Everett E Mills
Dave Baligo — source: IBM Community (ConnectedCommunity.org) Informix forum
Thank you all for the input and suggestions.
Have a great day,
--Dave
------------------------------
Dave Baligo
------------------------------
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.