Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql loop insert

CREATE PROCEDURE myproc()
BEGIN
    DECLARE i int DEFAULT 237692001;
    WHILE i <= 237692004 DO
        INSERT INTO mytable (code, active, total) VALUES (i, 1, 1);
        SET i = i + 1;
    END WHILE;
END
DELIMITER;
CALL myproc;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #loop #insert
ADD COMMENT
Topic
Name
6+6 =