Oracle SQL Developer:在网格中显示REFCURSOR结果吗? [英] Oracle SQL Developer: Show REFCURSOR Results in Grid?

查看:81
本文介绍了Oracle SQL Developer:在网格中显示REFCURSOR结果吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为问题从oracle存储过程获取结果集"的后续操作,是否可以显示存储过程的结果,该结果在SQL Developer中的网格中(而不是纯文本脚本输出"窗口)返回REFCURSOR?

As a follow-up to the question "Get resultset from oracle stored procedure", is there a way to show the results of a stored procedure that returns a REFCURSOR in a grid (instead of the plain text Script Output window) within SQL Developer?

答案有所帮助,但是在查看值"窗口中显示结果集仍然存在问题:

The answer helped, but I'm still having a problem displaying the result set in the "View Value" window:

列可能只能扩展少量,这可能是由于返回的结果数量所致.使用resizer控件扩展窗口无济于事:

The columns can only be expanded a small amount, probably due to the number of results being returned. Expanding the window with the resizer control doesn't help:

推荐答案

我认为您不能使用某个过程.

I don't think you can with a procedure.

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

Thanks to DCookie for simplifying my original answer.

但是,作为一种变通办法,您可以编写一个函数来调用该过程,然后使用SQL调用该函数.

But as a work-around you can write a function that calls the procedure and then invoke that using SQL.

例如

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

   myproc(rc);

   return rc;

END;

您可以通过以下方式致电:

Which you can then call with:

   select callmyproc()
   from dual;

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

When this example is run, the SQL Developer data grid shows one result but if you scroll right and click on the edit button, you will see the results in a grid.

这篇关于Oracle SQL Developer:在网格中显示REFCURSOR结果吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆