calling a proc in pl/sql which has out parameter as cursor.
I have a pkg and proc in the body.
The in paramerter to proc in table type and out parameter is cursor.
I am calling the proc from a pl/sql block and I am not able to print the cursor result of proc in the pl/sql block.
How can i achieve this ?
CREATE OR REPLACE PACKAGE TEST_PKG
IS
TYPE emp_tab is table of emp.empno%type index by pls_integer;
TYPE RC IS REF CURSOR;
PROcedure test_proc (tab in emp_tab,curout in out rc);
END;
/
create or replace package BODY test_pkg as
procedure test_proc (tab in emp_tab,curout in out rc) IS
begin
DBMS_OUTPUT.PUT_LINE('entry 1 is [' || tab(1) || ']');
OPEN curout FOR
SELECT DISTINCT .... from table;
end;
end;
/
Say above is the code and while trying to run the below Pl/SQL I want to see the cursor result, how do i see it ?
DECLARE
tab_test TEST_PKG.emp_tab;
cursoroutput TEST_PKG.RC
begin
TAB_TEST(1) := 20;
TEST_PKG.test_proc(tab_test,cursoroutput);
-- DBMS_OUTPUT.PUT_LINE( cursoroutput); didn't work
end;
Thanks and appreciate for the help
Thanks
/