Mit forslag vil være at indsætte rækkerne fra din markør i en midlertidig tabel. Tilslut derefter den midlertidige tabel med din eksisterende tabel for de filterkriterier, du nævner. Psuedokode:
create or replace function my_func
return sysrefcursor
is
cursor cursor_one is
SELECT * FROM table_one ;
cursor cursor_two is
SELECT * FROM table_one ;
BEGIN
FOR current_row in cursor_one
loop
-- do some modification on each row and insert into temporary table
end loop;
FOR current_row in cursor_two
loop
-- do some modification on each row and insert into temporary table
end loop;
-- results from cursor 1 and 2 exist in temporary table
open out_cursor for
select t.* from
my_temp_table t
join
my_other_table tt
on (t.col1 = tt.col1) -- or whatever columns are appropriate
where t.col2 = 'some criteria' -- or whatever filter criteria you like.
return out_cursor;
END;