how to clear a variable?
See following sample code, how do I reset or clear v_testtable for next loop fetch?
Thanks
declare
TYPE testtable2_aat IS TABLE OF testtable2%ROWTYPE INDEX BY PLS_INTEGER;
v_testtable2 testtable_aat;
begin
loop -- main loop here
-- exit main loop condition test here
select
1,2,3,4,5
BULK COLLECT INTO
v_testtable
from
testtable
where ....
;
dbms_output.put_line(nvl('1 '||v_testtable.last,-1));
FORALL i IN v_testtable.first..v_testtable.last
INSERT INTO testtable2
VALUES v_testtable2(i);
commit;
-- *******
-- Need to clear the variable
-- both following not work
v_testtable2 := null;
clear all from v_testtable2 ;
0