trigger 出错

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复合语句结构,能够定义执行多条语句的触发程序。请参见本节后面给出的示例。


http://dev.mysql.com/doc/refman/ ... html#using-triggers

作者: horizonhyg   发布时间: 2011-06-14