Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Unanswered: fire trigger after update on multiple columns in a table

    Hi all,
    Is it possible to create a single trigger to fire, upon update on multiple columns in a table, instead of a single column?
    For example, to fire a trigger upon update on a single column in table A, i have the following statements:

    create trigger trigger1
    after update of column1 on tableA
    ...
    ....


    how abt if there are a few columns in tableA which needs to fire the same trigger, if there is an update to those columns? Is it possible to put into a single trigger as follow?

    create trigger trigger1
    after update of column1, column2 column3 on tableA
    ...
    ....

    Really appreciate for any replies. Thanks.

  2. #2
    Join Date
    Aug 2004
    Posts
    330
    Yes you can do this. Note that the trigger will fire if the update statement references any of the columns, even if they are being updated to the same value. You may want to consider evaluating the transition variables in the WHEN clause to detect whether the columns are actually being updated to new values.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •