触发器

作者: cdz620 | 来源:发表于2020-03-05 10:20 被阅读0次

触发器

  • 对于同一个表相同的触发时间的相同触发事件,只能定义一个触发器
  • insert into ... on duplicate key update 触发的触发器顺序:
    • 若表中存在记录 before insert --> before update --> after update
    • 若表中不存在记录 before insert --> after insert
  • 触发器如果产生错误,不会回滚之前所做的操作
  • 触发器中禁止使用事务

触发器种类

  • before insert
  • after insert
  • before update
  • after update

相关命令

  • show triggers
  • desc triggers

相关文章

网友评论

      本文标题:触发器

      本文链接:https://www.haomeiwen.com/subject/kfzdchtx.html