gpt4 book ai didi

Mysql 未知标点符号字符串@12错误

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

我无法理解这段代码有什么问题。请帮忙:

    DELIMITER //
CREATE TRIGGER `project`.`insert_project_log` AFTER INSERT ON `project`.`projects`
FOR EACH ROW insert into
project_log(user,title,uploaded_file_name,submitted_at,submitted_by)
values(new.user,new.title,new.report_file_name,now(),new.submitted_by)
//
DELIMITER ;

我得到:

        ERROR: Unknown Punctuation String @ 12
STR: //
SQL:
DELIMITER //
CREATE TRIGGER `project`.`insert_project_log` AFTER INSERT ON `project`.`projects`
FOR EACH ROW insert into
project_log(user,title,uploaded_file_name,submitted_at,submitted_by)
values(new.user,new.thesis,new.report_file_name,now(),new.submitted_by)
//

最佳答案

用一个单词或一个字符串命名您的触发器,并封装在反引号中

DELIMITER //

CREATE TRIGGER insert_project_log AFTER INSERT ON `project`.`projects`
FOR EACH ROW
BEGIN
insert into project_log(user,title,uploaded_file_name,submitted_at,submitted_by)
values(new.user,new.title,new.report_file_name,now(),new.submitted_by);
END
//

DELIMITER ;

关于Mysql 未知标点符号字符串@12错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19355751/

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