trigger 出错
时间:2011-06-14
来源:互联网
delimiter //
create trigger station_info_trigger
before insert on station_info
for each row
Begin
If new.station_group1 is null then
set new.station_group1 = new.station_id;
END IF;
end;//
delimiter ;
--------------------------------------------------------------
我的sql语句如上所示。
mysql的版本是5.0的。
但是执行之后下面的错误是啥原因呢???
--------------------------------------------------------------
mysql> delimiter //
mysql> create trigger station_info_trigger
-> before insert on station_info
-> for each row
-> Begin
-> If new.station_group1 is null then
-> set new.station_group1 = new.station_id;
-> END IF;
-> end;//
ERROR 1235 (42000): This version of MySQL doesn't yet support 'multiple triggers
with the same action time and event for one table'
mysql> delimiter ;
create trigger station_info_trigger
before insert on station_info
for each row
Begin
If new.station_group1 is null then
set new.station_group1 = new.station_id;
END IF;
end;//
delimiter ;
--------------------------------------------------------------
我的sql语句如上所示。
mysql的版本是5.0的。
但是执行之后下面的错误是啥原因呢???
--------------------------------------------------------------
mysql> delimiter //
mysql> create trigger station_info_trigger
-> before insert on station_info
-> for each row
-> Begin
-> If new.station_group1 is null then
-> set new.station_group1 = new.station_id;
-> END IF;
-> end;//
ERROR 1235 (42000): This version of MySQL doesn't yet support 'multiple triggers
with the same action time and event for one table'
mysql> delimiter ;
作者: doushi 发布时间: 2011-06-14
QUOTE:
触发程序名称存在于方案的名称空间内,这意味着,在1个方案中,所有的触发程序必须具有唯一的名称。位于不同方案中的触发程序可以具有相同的名称。
在1个方案中,所有的触发程序名称必须是唯一的,除了该要求外,对于能够创建的触发程序的类型还存在其他限制。尤其是,对于具有相同触发时间和触发事件的表,不能有2个触发程序。例如,不能为某一表定义2个BEFORE INSERT触发程序或2个AFTER UPDATE触发程序。这几乎不是有意义的限制,这是因为,通过在FOR EACH ROW之后使用BEGIN ... END复合语句结构,能够定义执行多条语句的触发程序。请参见本节后面给出的示例。
在1个方案中,所有的触发程序名称必须是唯一的,除了该要求外,对于能够创建的触发程序的类型还存在其他限制。尤其是,对于具有相同触发时间和触发事件的表,不能有2个触发程序。例如,不能为某一表定义2个BEFORE INSERT触发程序或2个AFTER UPDATE触发程序。这几乎不是有意义的限制,这是因为,通过在FOR EACH ROW之后使用BEGIN ... END复合语句结构,能够定义执行多条语句的触发程序。请参见本节后面给出的示例。
http://dev.mysql.com/doc/refman/ ... html#using-triggers
作者: horizonhyg 发布时间: 2011-06-14
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28