1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| CREATE TABLE LOTO (b1 smallint, b2 smallint, b3 smallint, b4 smallint, b5 smallint);
COMMIT;
SET TERM ^ ;
EXECUTE BLOCK
AS
DECLARE VARIABLE nb_boules smallint = 49;
DECLARE VARIABLE b1 smallint = 1;
DECLARE VARIABLE b2 smallint;
DECLARE VARIABLE b3 smallint;
DECLARE VARIABLE b4 smallint;
DECLARE VARIABLE b5 smallint;
BEGIN
WHILE (b1<=nb_boules-4) DO
BEGIN
b2=b1+1;
WHILE (b2<nb_boules-3) DO
BEGIN
b3=b2+1;
WHILE (b3<nb_boules-2) DO
BEGIN
b4=b3+1;
WHILE (b4<nb_boules-1) DO
BEGIN
b5=b4+1;
WHILE (b5<nb_boules) DO
BEGIN
INSERT INTO LOTO (b1,b2,b3,b4,b5) VALUES (:b1,:b2,:b3,:b4,:b5);
b5=b5+1;
END
INSERT INTO LOTO (b1,b2,b3,b4,b5) VALUES (:b1,:b2,:b3,:b4,:b5);
b4=b4+1;
END
INSERT INTO LOTO (b1,b2,b3,b4,b5) VALUES (:b1,:b2,:b3,:b4,:b5);
b3=b3+1;
END
INSERT INTO LOTO (b1,b2,b3,b4,b5) VALUES (:b1,:b2,:b3,:b4,:b5);
b2=b2+1;
END
INSERT INTO LOTO (b1,b2,b3,b4,b5) VALUES (:b1,:b2,:b3,:b4,:b5);
b1=b1+1;
END
END^
SET TERM ; ^
COMMIT; |
Partager