mysql 创建存储过程 循环添加记录
先创建,然后调用
-- 创建存储过程
DELIMITER;//
create procedure myproc()
begin
declare num int;
set num=1;
while num <= 24 do
insert into t_calendar_hour(hourlist) values(num);
set num=num+1;
end while;
commit;
end;//
-- 调用存储过程
CALL myproc();