-- 往scott.emp表中插入1000条数据
delimiter //
drop procedure if exists scott.fun1;
create procedure scott.fun1()
begin
declare i int;(声明i为int类型)
set i=1;
repeat
insert into `scott`.`emp`
values
(
i,
(select substring(md5(rand()), 1, 6)),
'CLERK',
'7839',
SYSDATE(),
'1',
NULL,
'20'
);
set i=i+1;
until i>1000
end REPEAT;
end //
call scott.fun1()