Oracle: excluding updates of one column for firing a trigger

前端 未结 4 440
执念已碎
执念已碎 2021-01-04 14:20

In oracle I can specify the columns, which should induce a firing of a trigger:

create or replace trigger my_trigger
before update of col1, col2, col3 on my_         


        
4条回答
  •  一向
    一向 (楼主)
    2021-01-04 14:46

    I don't think there's a way you can avoid having to list all of the other columns in the table, either in the trigger body or else in the before update of ... clause.

    However, you might be able to write an alter trigger on the table to regenerate the update trigger automatically if any columns are added or removed. It's a little more work, but then the maintenance should be automatic.

提交回复
热议问题