数据库SQL(六):Triggers(触发器)

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时要

  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值