FOR ALL WITH RETURNING
Hi All,
My requirement is to return a set of values using forall returning clause.For that I am using
begin
----------
--------
FORALL J IN 1..M_T_TABLE1.COUNT SAVE EXCEPTIONS
INSERT INTO TABLE2 VALUES M_T_TABLE1(J)
RETURNING CUST_CODE BULK COLLECT INTO P_T_CUST_CODE;
exception
-----------
end;
This code is working fine and It is returning CUST_CODE values using P_T_CUST_CODE.
But there is a situation that i've to run this code in loop like..
begin
----------
--------
FOR I IN 1..NO_OF_ITERATIONS LOOP
FORALL J IN 1..M_T_TABLE1.COUNT SAVE EXCEPTIONS
INSERT INTO TABLE2 VALUES M_T_TABLE1(J)
RETURNING CUST_CODE BULK COLLECT INTO P_T_CUST_CODE;
END LOOP;
exception
-----------
end;
NOW IT IS RETURNING THE VALUES INSERTED IN LAST ITERATION ONLY .BUT I WANT THE VALUES INSERTED IN ALL ITERATIONS.
ANY IDEA HOW TO ACHIVE THAT?
THANKS IN ADVANCE.
NM