Create table on the basis of ref cursor.
Hi,
Would like to know whether a temporary table can be created in a PL/SQl procedure on the basis of a ref cursor passed as an input parameter to it. Pseudo code for the same is below:
Create Function Func_name(Some_var Varchar2)
return sys_Refcursor
is
v_sys_refcursor sys_Refcursor;
begin
Open v_sys_refcursor for some_query;
return v_sys_refcursor;
end;
Create procedure Proc_name(v_sys_refcursor IN sys_Refcursor)
is
v_Sql varchar2(250);
begin
v_Sql:="Create table statement."----> Table structure determined from ref cursor
Execute immediate v_Sql;
Some_Executeion();
End;
Regards,
Adi