Hey All,
Back again, with yet another pretty specific thing I'd like to learn how to do. I'm currently writing a procedure that manipulates data stored in a temporary table.
There's a procedure owned by my current user, that returns a cursor pointing to the exact row set I'd like to initially seed the temporary table with, before doing some operations on said table.
Now, I know the cursor being returned is not to be used like a row set, and that the cursor is not a moving part as well; which leads me to ask: What's required to get the data I want in the table?
The procedure is called by an application, so turning it into a function is not an option.
Here's an example of an implicit returning procedure:
create or replace procedure procedurename(p_var in number)
as
refcursor sys_refcursor;
begin
open refcursor for
select p_var
from dual;
dbms_sql.return_result(refcursor);
end;
/
Now, here's the general idea of what I'd like to do in PL-SQL (This one-liner actually works in SQL Server):
begin
insert into tablename procedurename(1);
end;
/
Obviously there's cursor related coding that needs to be done, but what's the best way to do this without bogging down the engine?
Answers are always appreciated, however explanations of answers are the best type of contribution to our community.