gpt4 book ai didi

mysql - 创建程序不起作用,没有给我错误代码

转载 作者:行者123 更新时间:2023-11-29 23:26:00 25 4
gpt4 key购买 nike

我在让下面的代码工作时遇到了麻烦,当我将其输入mysql时,它没有给我一个特定的错误,它只说没有原因的错误或任何错误号,任何可以帮助我注意到的人我忘记了什么或做错了什么吗?

DELIMITER $$
CREATE PROCEDURE randomMaker(v1 int)
BEGIN
DROP TABLE IF EXISTS pplGrp
CREATE TEMPORARY TABLE pplGrp(FirstName_tmp varchar(255), LastName_tmp varchar(255));
WHILE (v1 > 0) DO
CALL FirstName_gen();
CALL LastName_gen();
INSERT INTO pplGrp (FirstName_tmp, LastName_tmp)values(FirstName_gen(), LastName_gen());
SET v1 = v1 - 1;
END WHILE;
select FirstName_tmp as 'First Name', LastName_tmp as 'Last Name' FROM pplGrp
END;
DELIMITER ;

最佳答案

尝试:

DELIMITER $$

CREATE PROCEDURE randomMaker(v1 int)
BEGIN
DROP TABLE IF EXISTS pplGrp;
CREATE TEMPORARY TABLE pplGrp(FirstName_tmp varchar(255), LastName_tmp varchar(255));
WHILE (v1 > 0) DO
CALL FirstName_gen();
CALL LastName_gen();
INSERT INTO pplGrp (FirstName_tmp, LastName_tmp)values(FirstName_gen(), LastName_gen());
SET v1 = v1 - 1;
END WHILE;
select FirstName_tmp as 'First Name', LastName_tmp as 'Last Name' FROM pplGrp;
END$$

DELIMITER ;

关于mysql - 创建程序不起作用,没有给我错误代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26962264/

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