Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Create table on the basis of ref cursor.

adinewbieSep 14 2010 — edited Sep 14 2010
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2010
Added on Sep 14 2010
5 comments
2,132 views