Bulk delete [message #169111] |
Tue, 25 April 2006 02:36 |
murtuja_oracle
Messages: 5 Registered: December 2005
|
Junior Member |
|
|
Hello friends
I want syntax (sample procedure code) for bulk delete.I m inserting data using bulk collection and Forall Loop.
Can u provide me syntax (sample procedure code) for bulk delete.
Note:I hv to delete very less percentage of rows so Truncate
and create table as select is not useful for me.
Below procedure is for Bulk insert and it works fine:
CREATE OR REPLACE PROCEDURE fast_insert
AS
vCount NUMBER;
vSysdate DATE;
TYPE books_aat
IS TABLE OF OLD_CARDIO_SET%ROWTYPE
INDEX BY PLS_INTEGER;
books books_aat;
BEGIN
SELECT /*+ rule */
d.*
BULK COLLECT INTO books
FROM
CARDIO_WORKOUT a,
CARDIO_ACTIVITY b,
CARDIO_ACTIVITY_CHANGED c,
OLD_CARDIO_SET d
WHERE a.workout_nr = b.workout_nr
AND b.activity_nr = c.new_activity_nr
AND c.change_nr = d.change_nr
AND a.person_nr =123456;
FORALL book_index
IN books.FIRST .. books.LAST
INSERT INTO OLD_CARDIO_SET
VALUES books(book_index);
vCount := SQL%rowcount;
END;
/
Summary:
I want to delete records by using Bulk Collection
|
|
|
|
|