Trigger calls in cascade deleting(在级联删除中触发调用)
问题描述
我在 MySQL 中有表A".它有一些对其他一些表(B"、C"、D"...)的级联删除的引用.当某些内容从A"中删除时,我需要使用触发器.当我直接从A"删除记录时,此触发器起作用.但它不适用于级联删除.是否存在任何版本的 MySQL,我的触发器可以与级联删除一起使用?或者,也许还有另一种调用方式
I have table "A" in MySQL. It has some references with cascade deleting to some other tables ("B", "C", "D" ...). I need to use a trigger when something deletes from "A". This trigger works when I delete records from "A" directly. But it doesn't work with cascade deleting. Does any version of MySQL exist where my trigger will work with cascade deleting? Or, maybe, there is another way to call
推荐答案
来自http://dev.mysql.com/doc/refman/5.6/en/innodb-restrictions.html
级联外键操作不会激活触发器
Cascaded foreign key actions do not activate triggers
换句话说,您不能将触发器与级联删除一起使用.
In other words, you cannot use the trigger with cascaded deleting.
另见相关错误:
- MySQL:https://bugs.mysql.com/bug.php?id=11472
- MariaDB:https://jira.mariadb.org/browse/MDEV-19402
这篇关于在级联删除中触发调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在级联删除中触发调用


- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- SQL 临时表问题 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01