文章目录
1、what are triggers
A trigger is a statement that is executed automatically by the system as a side effect of a modification to the database. (insert, delete, update)
Also called event-condition-action rules (ECA).
A trigger allows the programmer to specify when the check occurs and under which conditions a set of actions should be performed.
A trigger allow applications to monitor database events (activities) and take actions when specified events take place.
To design a trigger mechanism, we must:
Specify the event causes the trigger and the conditions must be satisfied for trigger execution. (when a trigger is to be executed)
Specify the actions to be taken when the trigger executes.
也就是说,Trigger是一个语句,这个语句在满足一定条件时自动执行:当对数据库进行修改(增、删、改)时,记录的值满足特定条件时。Trigger也称为event-condition-action规则。
应用trigger可以使应用程序监控数据库的一些事件。
应用trigger时要