DELIMITER $$

CREATE PROCEDURE myFunction()
BEGIN

    DECLARE i INT DEFAULT 1;

    WHILE (i < 500000) DO
        INSERT INTO `test table` (num, name, email)
        VALUE (i, CONCAT(‘test’, i), HEX(AES_ENCRYPT(CONCAT(‘test’, i, ‘@test.com’), ‘key’)));
        SET i = i + 1;
    END WHILE;
END$$

DELIMITER ;
CALL myFunction();




http://hangaebal.blogspot.kr/2014/07/mysql-procedure-loop-insert.html

+ Recent posts