MySQL存过
1.MySQL没有匿名块
2.存过模板
drop procedure 存过名;
delimiter $$
create procedure 存过名(
begin
declare num int;
declare batchno varchar(2);
set num=1;
while num < 25 do
if num < 10 then
set batchno = concat('0',num);
else
set batchno =concat(num);
end if;
INSERT INTO t task date
(taskdate.status.description.task cnt. success cnt.failed cnt. task hour. aroup
VALUES( 20250414', 'COMPLETED',"任务批次内所有任务均已执行完成’,24.0.0. batchno, 1. 'Group1');
set num=num + 1:
end while;
end$$
delimiter;
call 存过名();