OUTPUT Of SYS_REFCURSOR [message #628659] |
Wed, 26 November 2014 15:28 |
azeem87
Messages: 116 Registered: September 2005 Location: dallas
|
Senior Member |
|
|
hi,
was trying to execute this procedure , not able the see the output ,
i have set dbms_output ON also, it works runs successfully,
gives error on dbms-utput in this code,
aim is to see the output of this execution result.
SET SERVEROUTPUT ON
DECLARE
P_CUST_ID VARCHAR2(32);
P_INPT_CD VARCHAR2(2);
P_PROD_CD VARCHAR2(20);
P_RLSED_DT DATE;
P_FIRST_IN VARCHAR2(32767);
P_EXCL_TBL_IN VARCHAR2(32767);
P_HIST_DATE DATE;
P_CURSOR SYS_REFCURSOR;
BEGIN
P_CUST_ID := NULL;
P_INPT_CD := NULL;
P_PROD_CD := NULL;
P_RLSED_DT := NULL;
P_FIRST_IN := NULL;
P_EXCL_TBL_IN := NULL;
P_HIST_DATE := NULL;
-- P_CURSOR := NULL; Modify the code to initialize this parameter
PKG_SEARCH.SEARCH_TXNS('', 'A', 'RETURNS', '10-NOV-2014','R', 'F', '09-NOV-2014', P_CURSOR );
--DBMS_OUTPUT.PUT_LINE(' V_RETURN = ' || ' ' || P_CURSOR);
COMMIT;
END;
/
any idea how can i see the output, i have tried in SQL Developer, SQL Plus and Toad, all same.
shows this PL/SQL procedure successfully completed.
but no output.
|
|
|
|
Re: OUTPUT Of SYS_REFCURSOR [message #628663 is a reply to message #628661] |
Wed, 26 November 2014 15:56 |
cookiemonster
Messages: 13920 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
To be clear on why your attempt didn't work - you opened the ref cursor but you didn't fetch from it. The sqlplus print command does that for you. Otherwise you need to write a loop that'll fetch the results (with the fetch command) into appropriate variables. You can then display the contents of those variables.
All that said - just use the print command.
|
|
|
|