mysql存储过程
DROP PROCEDURE IF EXISTS Insert100kRows;
DELIMITER $$
CREATE PROCEDURE Insert100kRows()
BEGIN
DECLARE result VARCHAR(100) DEFAULT '';
DECLARE i INT DEFAULT 1;
WHILE i <= 10 DO
SET @re = CONCAT(result, CHAR(65 + FLOOR(RAND() * 26)));
set @rn = IF(RAND()>=0.5,1,0);
set @fl = FLOOR(RAND() * 100);
INSERT INTO baiwan_users(name, intro, gender) VALUES(concat(@re,@fl),CONCAT(@re,@rn),@rn);
SET i = i + 1;
END WHILE;
END$$
DELIMITER ;
CALL Insert100kRows();
原文地址:https://blog.csdn.net/zwm_yy/article/details/140575143
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!