1
使用MySQL 5.1.43。MySQL - 插入觸發語法之前?
我想創建一個觸發器這樣的:
USE `databaseA`;
DELIMITER $$
CREATE DEFINER=`root`@`localhost` trigger triggerName
BEFORE INSERT ON tableA
FOR EACH ROW BEGIN
IF(convert(new.subTime, signed) > '600') THEN
SET new.fieldA = new.fieldB;
END IF;
END$$
當我插入一條記錄的FIELDA字段不更新。
我的語法有什麼問題嗎?
我可以在觸發器中使用CONVERT語句嗎?
This SO question has a similar problem: http://stackoverflow.com/questions/1211792/mysql-trigger-to-update-a-field-to-the-value-of-id – 2010-05-26 15:58:38