</insert>
=====================================================================
declare
type t_array is table of t_target%rowtype;
t_data t_array;
cursor c is
select null id, owner, object_name, null object_id, null xx, null yy
from dba_objects;
begin
open c;
loop
fetch c bulk collect
into t_data limit 100;
forall i in 1 .. t_data.count
insert into t_target values t_data (i);
exit when c%notfound;
end loop;
close c;
commit;
end;
<insert id="insertByProc" statementType="CALLABLE">
{call insertPro(#{name},#{age},#{sex},#{password},#{num})}
</insert>
1 CREATE DEFINER = `root`@`localhost` PROCEDURE `NewProc`(IN `name_in` varchar(255),IN `age_in` int,IN `sex_in` varchar(255),IN `password_in` varchar(255),IN `num_in` int) 2 BEGIN 3 SET @a=0; 4 Label:LOOP 5 SET @a=@a+1; 6 INSERT INTO person ( name, age, sex, password) VALUES (name_in,age_in,sex_in,password_in); 7 IF @a=num_in THEN 8 LEAVE Label; 9 END IF; 10 END LOOP Label; 11 END;