PL/SQL Insert Big Data and Commit

declare
  v_counter number:=0;
begin
  for j in 1..1000000 loop
      insert into test_table
      (
        id,
        kurum_id,
        tur_id,
        adi,
        aktif,
        kayit_kullanici_id,
        kayit_tarihi
      )
      values
      (
        SEQ_TEST_TABLE_ID.nextval,
        1,
        1,
        'TEST_DATA_'|| j,
        1,
        1,
        sysdate
      );
      v_counter:=v_counter+1;
      if mod(v_counter, 10000 ) = 0 then    -- Commit every 10000 records
        commit;
        dbms_output.put_line(v_counter||'-> committed');
      end if;
    end loop;
end;

Comments

Popular posts from this blog

Solution for the fault: "System.Diagnostics.Process.Start is not working on IIS, but working on ASP.NET Development Server"

Solution for "Can not obtain Oracle client information from registry"