1、试验用表结构
ARCER@ PROD>desc t; Name Null? Type ----------------------------------------------------- -------- ------------------------------------ ID NOT NULL NUMBER NAME NOT NULL VARCHAR2(10) BIRTHDAY DATE
2、脚本内容
declare -- a counter g_counter number(10) := 1; -- every 1000 rows ,to commit g_commit number(10); begin loop insert into t values(g_counter,‘arcerzhang‘,sysdate); --every 1000 rows , to commit; g_commit := mod(g_counter,1000); if g_commit = 0 then commit; dbms_output.put_line(g_commit); end if; g_counter := g_counter + 1; --exit conditions exit when g_counter > 10000; end loop; end; /