gpt4 book ai didi

mysql - 添加触发器时语法错误

转载 作者:行者123 更新时间:2023-11-29 18:14:31 25 4
gpt4 key购买 nike

我有程序:

    CREATE PROCEDURE channge_max_priority()
BEGIN
update feeds set max_post_priority =
(
select max(feed_posts.priority)
from feed_posts
where feed_posts.feed_id = feed_id
)
where feeds.id = feed_id;
END

我想创建三个触发器:

      CREATE TRIGGER feed_post_after_test AFTER INSERT (And update and delete ) ON feed_posts
FOR EACH ROW EXECUTE PROCEDURE change_max_priority();

程序工作正常,但是当我尝试启动触发器时 - 我收到错误:

Error in query (1064): Syntax error near 'PROCEDURE change_max_priority()' at line 2

最佳答案

您的名称过程中有一个双 nn :

替换:

CREATE PROCEDURE channge_max_priority()

CREATE PROCEDURE change_max_priority()

关于mysql - 添加触发器时语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47133107/

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