Hi all,
I have a procedure which has 2 output parameters.
create procedure pro_A(la out ref_cur, lb out ref_cur)
is
begin
....
la := v_one;
lb := v_two;
....
I need to use ref cursors because both la and lb might return multiple records when called.
So I wrote a package something like this:
CREATE OR REPLACE PACKAGE Cross_RefCur_pkg
AS
TYPE crosscur IS REF CURSOR;
PROCEDURE pro_A(la out crosscur , lb out crosscur);
END Cross_RefCur_pkg;
/
CREATE OR REPLACE PACKAGE BODY Cross_RefCur_pkg
AS
PROCEDURE pro_A(la out crosscur , lb out crosscur)
IS
v_cur crosscur;
BEGIN
OPEN v_cur FOR SELECT .....
END pro_A;
END Cross_RefCur_pkg;
/
What I don't understand is the FOR SELECT part of it. I am not populating the results of la and lb to a table. So I'm not sure how I should write the package body.
Any help will be greatly appreciated.
Thank you!
I have a procedure which has 2 output parameters.
create procedure pro_A(la out ref_cur, lb out ref_cur)
is
begin
....
la := v_one;
lb := v_two;
....
I need to use ref cursors because both la and lb might return multiple records when called.
So I wrote a package something like this:
CREATE OR REPLACE PACKAGE Cross_RefCur_pkg
AS
TYPE crosscur IS REF CURSOR;
PROCEDURE pro_A(la out crosscur , lb out crosscur);
END Cross_RefCur_pkg;
/
CREATE OR REPLACE PACKAGE BODY Cross_RefCur_pkg
AS
PROCEDURE pro_A(la out crosscur , lb out crosscur)
IS
v_cur crosscur;
BEGIN
OPEN v_cur FOR SELECT .....
END pro_A;
END Cross_RefCur_pkg;
/
What I don't understand is the FOR SELECT part of it. I am not populating the results of la and lb to a table. So I'm not sure how I should write the package body.
Any help will be greatly appreciated.
Thank you!