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

时间:2014-11-16 21:30:31

标签: mysql

我无法让下面的代码工作,当我将它输入到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 ;

1 个答案:

答案 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 ;