plsql - Oracle Stored Procedures using temp tables -
i new oracle , need solve following problem.
inside stored proc want return 2 cursors this.
procedure myproca() begin open refcursora select id, ..... tablea ..... long series of conditions open refcursorb select * table b b.id in (select id tablea ..... long series of conditions)
this how have stored proc @ moment don't repetition. clause sql in parentheses in 2nd cursor same first cursor. how can load temp table or associative array or use in both cursors.
thanks in advance
it seems need ref cursor
how declare ?
cursor cursor_name ref cursor;
how use ?
open cursor_name select query loop fetch cursor_name some_variable; exit when cursor_name%notfound; do_something; end loop; close cursor_name;
so, same cursor variable point different sql area dynamically.
or
you can see cursor expression
Comments
Post a Comment