Navicat保存存储过程报错 1303

打开navicat软件,编写存储过程后,点击“保存”,报错信息为: 1303    //Message: Can't create a PROCEDURE from within another stored routine,无法保存

 

CREATE DEFINER=`root`@`localhost` PROCEDURE `CRM_test`()
BEGIN
 #Routine body goes here...
 DECLARE i INT DEFAULT 888801;
DECLARE CUST_EMPID INT DEFAULT 0;
 WHILE i<888830 DO
 #insert customer
 SET CUST_EMPID=i+rand()%30;
 insert into sysadmin_tbl_customer(Code,Name)
 VALUES(i,CUST_NAME);
 set i=i+1;
 END WHILE;

END;

原因:新建存储过程后,CREATE DEFINER=`root`@`localhost` PROCEDURE `CRM_test`() 已经默认存在了,不应该再次编写一次,否则会重复,以下程序可以正常保存。

BEGIN
 #Routine body goes here...
 DECLARE i INT DEFAULT 888801;
 DECLARE CUST_EMPID INT DEFAULT 0;
 WHILE i<888830 DO
 #insert customer
 SET CUST_EMPID=i+rand()%30;
 insert into sysadmin_tbl_customer(Code,Name)
 VALUES(i,CUST_NAME);
 set i=i+1;
 END WHILE;

END


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29056818/viewspace-766850/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29056818/viewspace-766850/

你可能感兴趣的:(Navicat保存存储过程报错 1303)