0

I've been trying to view a resultset from a stored procedure call in SQL Developer, but all I can see in "Script Output" tab are the result set's column names. The same code in Toad displays the records in "Grid" but I'm having trouble displaying the same output in SQL Developer.

Code I'm using as follows:

create or replace PROCEDURE test_proc (
                          r_recordset      OUT SYS_REFCURSOR)
    IS
      sql_stmt   CLOB := NULL;
    
    BEGIN
      sql_stmt := 
        'select * from test_table';
      OPEN r_recordset FOR sql_stmt;
    END;

then

set serveroutput on;
variable Out_Ref_Cursor refcursor;
EXECUTE test_proc(:Out_Ref_Cursor);
print :Out_Ref_Cursor;

I've turn on DBMS output and connected it to the database but there's absolutely nothing displayed in that window. Buffer size is 20000. Like this answer suggests: Printing the value of a variable in SQL Developer I'm wondering if I'm missing a setting or a view. FYI: total number of records in test_table are 48.

I have also tried

DECLARE
Out_Ref_Cursor refcursor
BEGIN
test_proc (:Out_Ref_Cursor);
dbms_output.put_line(Out_Ref_Cursor);
END;
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
muttonchops
  • 104
  • 8
  • Does this answer your question? [How to display the results of a ref cursor using SQL Developer](https://stackoverflow.com/questions/54486796/how-to-display-the-results-of-a-ref-cursor-using-sql-developer) – astentx Mar 31 '23 at 21:48
  • no, I've tried everything in that answer but didn't work. that answer also relates to a function and not a store proc so I assumed that's why it didn't work for me – muttonchops Mar 31 '23 at 22:46

2 Answers2

0

I have everything I need to test your issue except for your TEST_TABLE. Your example, re-written for HR.COUNTRIES

enter image description here

thatjeffsmith
  • 20,522
  • 6
  • 37
  • 120
0

Solved! uninstalling and installing a new version of SQL Developer with a new JDK did the trick

muttonchops
  • 104
  • 8