Oracle SQL Developer:在网格中显示REFCURSOR结果?

tec*_*cal 9 oracle stored-procedures oracle-sqldeveloper

作为"从oracle存储过程获取结果集"这一问题的后续内容,有没有办法显示REFCURSOR在SQL Developer 中返回网格(而不是纯文本脚本输出窗口)的存储过程的结果?

编辑:答案有所帮助,但我仍然在"查看值"窗口中显示结果集时遇到问题:

替代文字

这些列只能扩展少量,可能是由于返回的结果数量.使用缩放器控件扩展窗口没有帮助:

替代文字

Ian*_*ter 9

我不认为你可以用程序.

编辑:感谢DCookie简化我的原始答案.

但作为一种解决方法,您可以编写一个调用该过程的函数,然后使用SQL调用该函数.

例如

create or replace function callmyproc
return sys_refcursor
IS
   rc   sys_refcursor;
BEGIN

   myproc(rc);

   return rc;

END;
Run Code Online (Sandbox Code Playgroud)

然后你可以打电话给:

   select callmyproc()
   from dual;
Run Code Online (Sandbox Code Playgroud)

运行此示例时,SQL Developer数据网格显示一个结果,但如果向右滚动并单击编辑按钮,您将在网格中看到结果.