Last active
March 9, 2022 01:14
-
-
Save forstie/2b74a28b5598c243315d0bf516d66b90 to your computer and use it in GitHub Desktop.
This example shows how to use the ALLOW_DDL_CHANGES_WHILE_OPEN QAQQINI option within a specific job to avoid the requirement of needing an exlusive lock for the *FILE object, before making a change to a trigger program.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Create, Replace, Delete, or Disable trigger programs | |
-- without acquiring an exclusive lock over the file | |
-- ======= | |
-- | |
-- Resource: ibmsystemsmag.com/blogs/i-can/august-2017/manage-trigger-programs-in-productions | |
-- Prepare to break the rules | |
call qsys2.override_qaqqini(1, '', ''); | |
-- Rules broken | |
call qsys2.override_qaqqini(2, | |
'ALLOW_DDL_CHANGES_WHILE_OPEN', | |
'*YES'); | |
CREATE OR REPLACE TRIGGER toystore.new_hire | |
AFTER INSERT ON toystore.employee | |
FOR EACH ROW MODE DB2SQL | |
UPDATE toystore.company_stats | |
SET Number_of_employees = Number_of_employees + 1; | |
-- Done breaking the rules | |
call qsys2.override_qaqqini(3, '', ''); | |
Thanks, this is now fixed.
btw...
You welcome
Thank you for all these interesting things !
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-- Done breaking the rules
call qsys2.override_qaqqini(3, '', '');