Bookmark and Share
an example of loop insert in a MySQL procedure
(Publish Date: 2009-11-13 4:13pm, Total Visits: 10745, Today: 7, This Week: 16, This Month: 81)

delimiter //
CREATE PROCEDURE insert_temp()
    BEGIN
    DECLARE v1 INT;
    SET v1 = 2707242;
    WHILE v1 < 2721615 DO
    insert into temp_02 values (v1);
    SET v1 = v1 + 1;
    END WHILE;
    END;
//
delimiter ;