DROP PROCEDURE IF EXISTS test_insert;

DELIMITER ;; 
CREATE PROCEDURE test_insert () 
BEGIN 

DECLARE i int;
set i=14;
WHILE i<30 
DO 
    insert into student(name,age,nianji,phone) values(CONCAT('hh',i),CONCAT(i,''),'1','123');
SET i=i+1; 
END WHILE ; 
commit; 

END;; 

call test_insert () ;

 

posted on 2018-08-22 17:54  王洪洪  阅读(2554)  评论(0编辑  收藏  举报