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!

Multiple result with same refcursor

Ricky007Jun 28 2017 — edited Jun 29 2017

Dear experts,

         I want to return multiple query result with one refcursor.

create table cust

(

mobnum varchar2(20),

cust_name varchar2(20)

);

insert into cust values('9999','John');

CREATE table CUST_LOC_TB

(

mobnum varchar2(20),

cust_loc varchar2(20)

);

insert into CUST_LOC_TB values('9999','JAPAN');

create or replace

procedure test_proc_1

(

p_mob in varchar2,

p_out out sys_refcursor

)as

begin

begin

open p_out for

select cust_name from cust where mobnum=p_mob;

CLOSE P_OUT;

end;

begin

open p_out for

select cust_loc from CUST_LOC_TB where mobnum=p_mob;

CLOSE P_OUT;

end;

end ;

I know we can able to do by joining two tables,my actaul requirement is to have multiple result with same refcursor

EXPECTED RESULT

--------------

John

JAPAN

I am getting following error

pastedImage_0.png

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2017
Added on Jun 28 2017
6 comments
1,611 views