Oracle SQL Developer: Show REFCURSOR Results in Grid?(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 结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Oracle SQL Developer:在网格中显示 REFCURSOR 结果?
基础教程推荐
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 无法解决整理冲突 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
