Oracle利用儲存過程批量insert造資料和分批提交刪除的例子
i number :=1
begin
for i in 1..a
loop
Insert into ADZONES
(ADZONEID, NAME, FORMAT, TRANSTYPE, SIZECODE, ADZONESIZE, WEEKPRICE, CANSELLTIME, CREATETIME, UPDATETIME, STATUS, MEMBERID, SITEID, SITENAME, SITEURL, KEYWORDS, PROPERTIES, ADZONECATIDS, NEEDAUDITING, MARKS, EDITED, ISBUSY, CPMPRICE, CPMSTATUS, SNAPSHOTTIME, DISTYPE)
Values
(101514, '全站內頁200*200', '3', '7', '32', '250x300', 500, TO_DATE('08/31/2007 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2007 10:56:26', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2007 10:56:26', 'MM/DD/YYYY HH24:MI:SS'), 'N', 10001461, 100975, '屁屁視訊', 'http://www.ppgui.com', '娛樂', '{"sex":["1","多數是男的"],"income":["2","1000~3000"],"age":["2","18~25歲"],"hobby":"","job":["1,2,6,7","學生,職員,自由職業者,待業者"]}', '39999', '1', '0', '0', 1, 0.8, '0', TO_DATE('12/06/2007 17:21:19', 'MM/DD/YYYY HH24:MI:SS'), '1');
end loop;
commit;
dbms_output.put_line(maxrecords||' insert done');
end myj_insert;
/