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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Dynamic Ref Cursor with Dynamic Fetch

1050558Oct 29 2013 — edited Nov 1 2013

Hi Gurus,

I have a requirement where i need to build the Cursor dynamically where the number of Columns in the Select statement are not fixed, it keeps on changing and the result of the select statement need to pass to some other Record type which is an IN parameter for a seeded Oracle API. How we can do achieve it. Please fined the pseudo logicĀ  below.

Declare

l_api_rec_typ HZ_PARTYV2PUB.PARTY_REC_TYPE;

BEGIN

Select Col1.....Col5 into L_rec_type ---(which can be build based on the select statement Dynamically)

from dual;

-- Now the output of the above select statement needs to pass to the l_api_rec_type

l_api.rec_type.Col1:= l_rec_typ.Col1;

l_api.rec_type.Col2:= l_rec_typ.Col2;

l_api.rec_type.Col2:= l_rec_typ.Col3;

HZ_PARTY_V2PUB.CREATE_ORGANISAZTION (

l_api_rec_typ......x_msg_data,x_return_status ...etc);

END;

In the Above code the number of columns in select statements keeps on changing. So how i can assign the output of the Sleect Statement to the API record Type.

Thanks In Advance...

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2013
Added on Oct 29 2013
9 comments
916 views