I have an Oracle (21c) stored procedure that returns a cursor as an implicit result set using DBMS_SQL.RETURN_RESULT. I have another stored procedure that needs to call this first stored procedure and use that cursor without passing an OUT parameter for the cursor.
CREATE OR REPLACE NONEDITIONABLE PROCEDURE TESTPROC
(
V_USERACCOUNTID IN VARCHAR2
) AS
V_CURSOR SYS_REFCURSOR;
BEGIN
OPEN V_CURSOR FOR
SELECT * FROM USERACCOUNT WHERE ID = V_USERACCOUNTID;
DBMS_SQL.RETURN_RESULT(V_CURSOR);
END TESTPROC;
CREATE OR REPLACE NONEDITIONABLE PROCEDURE USETESTPROC
(
V_USERACCOUNTID IN VARCHAR2
) AS
V_CURSOR SYS_REFCURSOR;
BEGIN
TESTPROC(V_USERACCOUNTID);
-- how do you get the implicit result set from here into V_CURSOR?
DBMS_SQL.RETURN_RESULT(V_CURSOR);
END TESTPROC;
With a Procedure as in your question:
You can use the resultset with PL/SQL but you should do it using DBMS_SQL Package ... (comments in code)
OR you can just EXEC the procedure (SQLDeveloper) to get the resultset :