创建存储过程create procedure

创建存储过程create procedure


drop procedure if exists test01;
delimiter S E T A U T O C O M M I T = 0 SET AUTOCOMMIT = 0 SETAUTOCOMMIT=0

create procedure test01()
begin
declare v_cnt decimal (10) default 1000 ;
dd:loop
INSERT INTO customer_base_6 VALUES
(concat(1161,v_cnt,6),NULL,‘acfa44c15786b932860f4bc180e8b872a45e2f1670c457b30e7b7215’,NULL,NULL,concat(133555,v_cnt,6),NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,STR_TO_DATE(‘2015-05-13 18:48:22’,’%Y-%m-%d %H:%i:%s’),‘1’,‘0’,NULL,NULL,NULL,NULL,NULL,NULL,STR_TO_DATE(‘2015-05-14 11:02:09’,’%Y-%m-%d %H:%i:%s’),‘192.168.3.11’,‘新注册’,‘1’);
commit;
set v_cnt = v_cnt+1 ;
if v_cnt = 10000 then leave dd;
end if;
end loop dd ;
end;$$

delimiter ;

call test01;
select count(*) from customer_base_6;

你可能感兴趣的:(MYSQL)