我无法让下面的代码工作,当我将它输入到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 ;
答案 0 :(得分:0)
尝试:
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 ;