Topic
  • 1 reply
  • Latest Post - ‏2012-10-08T15:47:58Z by SystemAdmin
zoneaj
zoneaj
7 Posts

Pinned topic Database Trigger

‏2012-10-05T17:36:53Z |
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
    SystemAdmin
    1283 Posts

    Re: Database Trigger

    ‏2012-10-08T15:47:58Z  
    Hi
    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'
    BEGIN
    .....
    END;
    Regards

    Steve