oracle 循环每5000提交一次

     
      DECLARE
        j     number;
        s_sql varchar2(5000);
      BEGIN
        FOR j IN 1 .. 1000000 LOOP
          s_sql := 'insert into collect_data
        select t.test_start_date,
               t.test_end_date,
               t.test_qq,
               t.test_name,
               DQMP_PROBLEM_DATA_SEQ.NEXTVAL,
               t.dept,
               t.password_old1,
               t.password_old2,
               t.password_modify_date
          from test1 t';
          execute immediate s_sql;
          commit;
        END LOOP;
      END;

转载于:https://my.oschina.net/abcijkxyz/blog/721959

你可能感兴趣的:(oracle 循环每5000提交一次)