Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: need code for Bulk inserts

Re: need code for Bulk inserts

From: AnySQL (d.c.b.a) <anysql_at_gmail.com>
Date: 8 Mar 2006 06:25:21 -0800
Message-ID: <1141827921.274925.193950@e56g2000cwe.googlegroups.com>


Here is the bulk delete code

SQL> CREATE OR REPLACE PROCEDURE P_BULKDEL as   2 TYPE ARRAY_ROWID IS TABLE OF VARCHAR2(100) INDEX BY BINARY_INTEGER;
  3 tbrows ARRAY_ROWID;
  4 row PLS_INTEGER;
  5 cursor delete_table is select rowid from T_BULKDEL;   6 BEGIN
  7 open delete_table;
  8 loop

  9      fetch delete_table bulk collect into tbrows limit 100;
  10      FORALL row IN 1 .. tbrows.count()
  11        DELETE T_BULKDEL WHERE rowid = tbrows(row);
  12      -- tbrows.delete(1,tbrows.count());
  13      exit when delete_table%notfound;
  14 end loop;
  15 close delete_table;
  16 commit;
  17 END;
  18 / Received on Wed Mar 08 2006 - 08:25:21 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US