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/