--玩法:
--红球是从1-33中任选6个
--蓝球是从1-16中任选1个
drop table shuangseqiu;
create table shuangseqiu
(
qishu varchar2(8),
red1 number(2),
red2 number(2),
red3 number(2),
red4 number(2),
red5 number(2),
red6 number(2),
blue number(2),
fuzhu varchar2(10)
);
/
create or replace procedure chansheng
as
v_red1 number(2);
v_red2 number(2);
v_red3 number(2);
v_red4 number(2);
v_red5 number(2);
v_red6 number(2);
v_blue number(2);
begin
v_red1:=1;
v_red2:=2;
v_red3:=3;
v_red4:=4;
v_red5:=5;
v_red6:=6;
v_blue:=1;
--for i in 1..33 loop
for i in 2..33 loop
for i in 3..33 loop
for i in 4..33 loop
for i in 5..33 loop
for i in 6..33 loop
for i in 1..16 loop
insert into shuangseqiu(red1,red2,red3,red4,red5,red6,blue)
values (v_red1,v_red2,v_red3,v_red4,v_red5,v_red6,v_blue);
v_blue:=v_blue+1;
end loop;
v_blue:=1;
v_red6:=v_red6+1;
end loop;
v_red6:=v_red5+1;
v_red5:=v_red5+1;
commit;
end loop;
v_red5:=v_red4+1;
v_red6:=v_red5+1;
v_red4:=v_red4+1;
end loop;
v_red4:=v_red3+1;
v_red5:=v_red4+1;
v_red6:=v_red5+1;
v_red3:=v_red3+1;
end loop;
v_red3:=v_red2+1;
v_red4:=v_red3+1;
v_red5:=v_red4+1;
v_red6:=v_red5+1;
v_red2:=v_red2+1;
commit;
end loop;
--
v_red2:=v_red1+1;
--
v_red3:=v_red2+1;
--
v_red4:=v_red3+1;
--
v_red5:=v_red4+1;
--
v_red6:=v_red5+1;
--
v_red1:=v_red1+1;
--end loop;
commit;
end;
/
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28803801/viewspace-773368/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28803801/viewspace-773368/