oracle 存储过程 批量插入数据


CREATE OR REPLACE PROCEDURE p_insert_part
IS
 
 
--批量提交参数
num NUMBER;
begin
  num := 0;
  for i in 1 .. 20000
    loop
       num:=num+1;
      insert into SINO_LOANM (loan_code, creditor)
     values ('C01-20200609'|| to_char(num), 'KH20191628');
 
      num:=num+1;
      if mod(num,10000)=0 then
        commit;
      end if;
  end loop
  commit;
end;


---执行存储过程
begin
    p_insert_part ;
end;

你可能感兴趣的:(数据库)