Mysql基础——存储过程创建表数据
delimiter $$ CREATE PROCEDURE i_employees_ptarc (IN row_num INT) BEGIN DECLARE i INT DEFAULT 0 ; WHILE i < row_num DO INSERT INTO employees_ptarc (v_int, v_string, s_string) VALUES ( floor(1 + rand() * 1000000), substring( MD5(RAND()), 1, floor(1 + rand() * 20) ), substring(MD5(RAND()), 1, 20) ) ; SET i = i + 1 ; END WHILE ; END$$ delimiter ; call i_employees_ptarc(400000); /***存储过程***/
稳步前行,只争朝夕。