NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
1 reply Latest Post - 2012-10-08T15:47:58Z by SystemAdmin
Pinned topic Database Trigger
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
I'm looking to make a database trigger in Netcool Omnibus 7.3.0. I have another system that keeps updating a ticket incorrectly so I need to keep flipping the update back. So in the action command I'm just doing an update and undoing the changes. This update script will run every time the database is updated, which is constantly. I see there's a "When" tab, but I can't really find any information on this tab. I'd like to only run this script when I see these tickets being updated. Is this possible? Can anyone find any information on how to code this tab? Thanks.
Updated on 2012-10-08T15:47:58Z at 2012-10-08T15:47:58Z by SystemAdmin
SystemAdmin 110000D4XK1283 PostsACCEPTED ANSWER
Re: Database Trigger2012-10-08T15:47:58Z in response to zoneajHi
The WHEN condition can be used to control whether the body of the automation will be processed after the trigger has been fired.
You can control whether the trigger fires based on the data in the row or the new row. eg The following contrived example would only fire when an UPDATE statement was executed AND the TicketValue column had the value 'correct value' in the ObjectServer and the update sets the TicketValue to 'incorrect value'
BEFORE UPDATE ON alerts.status
FOR EACH ROW
WHEN new.TicketValue = 'incorrect value' AND old.TicketValue = 'correct value'