Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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.
--
-- 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(1, '', '');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.