Can I do something like it:
if i = 0 then
for cur_var in (select * from t0) loop
else
for cur_var in (select * from t1) loop
/*
a lot of lines here
*/
end loop;
even if I would try to do like it:
v_refcursor refcursor;
v_rec0 t0%rowtype;
v_rec1 t1%rowtype;
BEGIN
if i = 0 then
OPEN v_refcursor FOR SELECT * FROM t0
else
OPEN v_refcursor FOR SELECT * FROM t1
end if;
I need to use different record_variables for FETCH and repeat my /* a lot of
lines here */ couples time for different record variables.
Any idea how to do code only once ?
Thanks