create procedure p1()
begin
set @x=year(curdate());
label1:loop
if @x < 2100 then
begin
set @x=@x+1;
iterate label1;
end;
end if;
leave label1;
end loop label1;
select @x;
end;//
create procedure p1()
begin
set @x=1000000;
label1:loop
if @x >0 then
begin
set @x=@x-1;
insert into testing set name='testingdata';
select @x;
iterate label1;
end;
end if;
leave label1;
end loop label1;
end;//
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/90618/viewspace-438676/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/90618/viewspace-438676/