How to get multiple REFCURSOR in Data Grid?

The following works and causes the results to appear in the Data Grid.
PF9 Execute Statement

begin
  open :c for select dummy from dual;
end;

The following causes only the first cursor statement results to appear in the Data Grid.
PF9 Execute Statement

begin
  open :c1 for select 'first'  from dual;
  open :c2 for select 'second' from dual;
end;

The following causes only the second statement results to appear in the Data Grid.
PF9 Execute Statement

begin
  open :c1 for select 'first'  from dual;
  open :c1 for select 'second' from dual;
end;

PF5 and dbms_sql.return_result appears to not display the cursor (though it does if I "Execute SQL via TSR").

declare
  c sys_refcursor
begin
  open c for select 'hello world' from dual;
  dbms_sql.return_result(c);
end;
/

Note: I am familiar with using and printing bind variables.
The following works and shows the results of both statements in two Script Output "Grid" tabs.
PF5 Execute as script

variable c1 refcursor
variable c2 refcursor
begin
  open :c1 for select 'first'  from dual;
  open :c2 for select 'second' from dual;
end;
print c1
print c2

Using Toad for Oracle 13.3.0.181 and Microsoft Windows 10.0 build 19042.

Thank you in advance.

1 Like