gpt4 book ai didi

mysql - 如何更正我的存储过程

转载 作者:行者123 更新时间:2023-11-29 07:59:49 25 4
gpt4 key购买 nike

我将此代码用于存储过程

DELIMITER $$
CREATE STORED PROCEDURE
CREATE DEFINER=`root`@`localhost` PROCEDURE `pmod_db`.`regmee2`(img2 varchar(200), usrnme varchar(20),
psswrd varchar(50), frstnme varchar(50),lstnme varchar(50),email varchar(255))
BEGIN
insert into IMAGES (image_url) values (img2);
insert into dbo_users (user_name,password,firstname,lastname,email) values
(usrnme,psswrd,frstnme,lstnme,email);
insert into user_images (userid ,image_id ) select u.user_id ,i.image_id from dbo_users u ,images i where user_id=(select user_id from dbo_users where user_name=usrnme ) and image_id=(select image_id from images where image_url=img2);
END $$

DELIMITER ;

我收到以下错误

    #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 'STORED PROCEDURE CREATE
DEFINER=`root`@`localhost` PROCEDURE `pmod_db`.`regmee'
at line 1

最佳答案

该错误准确地指出了语法问题所在。命令是CREATE PROCEDURE ,而不是创建存储过程

关于mysql - 如何更正我的存储过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24159842/

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