开发者

MySQL - AFTER INSERT TRIGGER does not run UPDATE query?

Using MySQL 5.1.x

Trying to add a trigger to a table:

DELIMITER $$

CREATE TRIGGER 开发者_JAVA百科group AFTER INSERT ON dataTable
FOR EACH ROW BEGIN
UPDATE dataTable SET groupName = mid(longName,1,4) WHERE groupNAME IS NULL;
END$$

When I insert a record there is no update made. Is there a syntax error? Or can I not run the Update query on the after insert event?

UPDATE: There are 2 triggers on this table (a AFTER INSERT and BEFORE UPDATE).


In a MySQL trigger, you cannot invoke DML on the table that fires the trigger.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜