I have a stored procedure with several cursors. They are defined as IN OUT parameters. I would like to display the result of the cursors using SQL Developer. This is an example of the stored procedure:
SET serveroutput on;
DECLARE
p_input_stream VARCHAR2(200);
p_msg_code NUMBER;
p_msg_parms VARCHAR2(200);
p_return_code NUMBER;
p_trailer_cur sl_globals.curtype_weak;
BEGIN
/* Assign values to IN parameters */
p_input_stream := '24954286Mnull|5155035|2|436|SCAN|47720|XTRA|0105||5155035||||N|~|\r';
p_trailer_cur := null;
EXEC TRAILER_INFO(p_input_stream,
p_msg_code, p_msg_parms, p_return_code,
p_trailer_cur)
/* Display OUT parameters */
dbms_output.put_line('p_msg_code: ' || p_msg_code);
dbms_output.put_line('p_msg_parms: ' || p_msg_parms);
dbms_output.put_line('p_return_code: ' || p_return_code);
I have tried creating a refcursor variable and using it in place of p_trailer_cur
like this
VARIABLE trailer_cur refcursor;
EXEC TRAILER_INFO(p_input_stream,
p_msg_code, p_msg_parms, p_return_code,
:trailer_cur)
print trailer_cur;
I get the error:
SP2-0552: Bind Varialbe "trailer_cur is not declared.
The variable is declared so I don't understand the error.
EXEC
in your PL/SQL block? There is no such command in PL/SQL.