mysql 存储过程

-- 创建存储过程
delimiter $$
create   procedure proc02()
begin
    declare i int default 0;
    while i<10 do
            INSERT INTO demo.user ( name, age, salary, remark, work_time) VALUES ( '小红', 12, 1000, '打杂', '2011-05-01 12:00:00');
            set i = i + 1;
        end while;
end $$
dilimiter ;

-- 删除存储过程
drop procedure  proc02;

DROP PROCEDURE
IF	EXISTS proc02;

-- 调用
call proc02();

 

posted @ 2022-05-25 10:30  得好好活  阅读(29)  评论(0)    收藏  举报