Oracle 存储过程批量插入数据

时间:2022-06-09 09:53:40

oracle 存储过程批量插入大量数据

declare
numCount number;
userName varchar2(512);
email varchar2(512);
markComment varchar2(512);
maxId number; begin
numCount := 1;
userName := 'userName number : .';
email := 'email number : ';
markComment := 'markComment number .'; for i in 1 .. 1000 loop
for j in 1 .. 1000 loop insert into userInfo (userId, userName, email, markComment) values
(numCount, userName||numCount, email||numCount, markComment||numCount); numCount := numCount + 1;
end loop;
commit;
end loop;
end;
/