Eason

咸鱼咯

mysql存储过程一例

 

/*=========================================
/*创建一个名字为testinster15()的程序 
/*=========================================
delimiter $
create PROCEDURE testinsert15()
  BEGIN
        DECLARE v_num int;
        DECLARE V_MAX INT;
        SET v_num=0;
        SELECT MAX(PEOPLEID) INTO V_MAX FROM PEOPLE;
        REPEAT
                SET v_num = v_num + 1;
                UPDATE PEOPLE SET LASTNAME = UUID();
                UPDATE PEOPLE SET FIRSTNAME = UUID();
        UNTIL v_num = V_MAX END REPEAT;
    commit;
  END
$
delimiter
/*=========================================
/*创建一个名字为testinster150()的程序 
/*=========================================
delimiter $
create PROCEDURE testinsert150()
  BEGIN
        DECLARE v_num int;
        SET v_num=0;
        REPEAT
                SET v_num = v_num + 1;
                insert into people (name,lastname,firstname) values (uuid(),uuid(),uuid());
        UNTIL v_num > 1500001 END REPEAT;
    commit;
  END
$

 

,

Comments are currently closed.