How to see refcursor result/output in Oracle SQL Developer? [duplicate] How to see refcursor result/output in Oracle SQL Developer? [duplicate] oracle oracle

How to see refcursor result/output in Oracle SQL Developer? [duplicate]


You can use a bind variable declared in SQL Developer to hold and show the results:

var r refcursor;exec myPackage.mySPTest(P_NOTIFICATION_ID => 1975357, P_CURSOR => :r);print r;

exec is shorthand for an anonymous block so this is equivalent to:

var r refcursor;begin    myPackage.mySPTest(P_NOTIFICATION_ID => 1975357, P_CURSOR => :r);end;/print r;

Unless P_CURSOR is declared as something unhelpful, maybe...


To view your cursor results you need to loop through your cursor and print values. You need to know column names for what your cursor is returning. You can do something like:

DECLARE   type output_cursor is ref cursor;   P_CURSOR output_cursor;BEGIN   P_CURSOR := NULL;   DOCTORS_APP.get_reminders (  P_NOTIFICATION_ID => 1975357,P_CURSOR => P_CURSOR) ;   //replace Column1 and Column2 with actual column names   FOR CUR_VAL in P_CURSOR LOOP        DBMS_OUTPUT.PUT_LINE(CUR_VAL.Column1||' '||CUR_VAL.Column2);   END LOOP; END;