gpt4 book ai didi

mysql - 触发,不插入

转载 作者:行者123 更新时间:2023-11-29 23:48:02 30 4
gpt4 key购买 nike

错误

SQL 查询:文档

CREATE TRIGGER `triggers_div` AFTER INSERT ON `produits`
FOR EACH
ROW
BEGIN
INSERT INTO `div_extension` ( `devID` )
SELECT new.devID
FROM `produits`
WHERE new.depID =1;

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

有人可以帮助我吗?

最佳答案

分隔符$$在插入 produits 后创建触发器 triggers_div对于每个排开始

//这里有一些编码......

结束;$$分隔符;

现在,当我添加像这样的 DELIMITER $$ 而不是像这样的 DELIMITER$$ 的 DELIMITER 时,它就可以工作了。

关于mysql - 触发,不插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25810737/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com