-1
CREATE TRIGGER `lastedited` AFTER UPDATE ON `eng-jap`
FOR EACH ROW
BEGIN
UPDATE `mrhowtos_main`.`eng` 
SET `lastmodified` = CURRENT_TIMESTAMP WHERE `eng`.`english` = old.eng;
UPDATE `mrhowtos_main`.`jap` 
SET `lastmodified` = CURRENT_TIMESTAMP WHERE `jap`.`japanese` = old.jap;
END;

MySQL返回的错误是:MySQL说:文档

#1064 - You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near '' at line 5 
4

1 回答 1

1
#START TRIGGER
    delimiter $$
    CREATE TRIGGER `lastedited` AFTER UPDATE ON `eng-jap`
    FOR EACH ROW
    BEGIN
    UPDATE `mrhowtos_main`.`eng` 
    SET `lastmodified` = CURRENT_TIMESTAMP WHERE `eng`.`english` = old.eng;
    UPDATE `mrhowtos_main`.`jap` 
    SET `lastmodified` = CURRENT_TIMESTAMP WHERE `jap`.`japanese` = old.jap;
    END;
    $$

如果仍然无法正常工作,请尝试将 old.eng 和 old.jap 替换为静态值,例如“roma”

于 2012-05-16T00:35:36.790 回答