Oracle SQL Developer:如何查看引用游标的结果?
如果我有一个返回查询引用游标的函数,我如何在 SQL Developer 中查看其结果集? Toad 有一个特殊的选项卡,用于查看参考光标的结果,这是我想要找到的功能。
If I have a function which returns a reference cursor for a query, how can I view the result set of this in SQL Developer? Toad has a special tab for viewing the results of a reference cursor, this is the functionality I would like to find.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
双击结果记录中的光标字段。 右侧有一个“...”图标。 点击这个就可以看到内容了
Double click the cursor fields in your result record. On the right side there is a "..." icon. Click this and you'll see the contents
嗨,我知道这是不久前被问到的,但我刚刚弄清楚了这一点,它可能对其他人有帮助。 不确定这是否正是您正在寻找的内容,但这就是我调用存储过程并在 SQL Developer 中查看输出的方式。
在 SQL Developer 中查看过程时,右键单击并选择“运行”或选择 Ctrl+F11 打开“运行 PL/SQL”窗口。 这将创建一个包含您需要修改的输入和输出参数的模板。 要返回 sys_refcursor 的结果,您需要声明一个与 proc 返回的 select stmt / sys_refcursor 完全等效的行类型。 下面我声明与我的输出字段匹配的“type t_row”,然后循环返回的 sys_refcursor。 如果 t_row 与我的 sys_refcursor 匹配,则它会填充 sys_refcursor 的每一行:
Hi I know this was asked a while ago but I've just figured this out and it might help someone else. Not sure if this is exactly what you're looking for but this is how I call a stored proc and view the output in SQL Developer.
In SQL Developer when viewing the proc, right click and choose 'Run' or select Ctrl+F11 to bring up the Run PL/SQL window. This creates a template with the input and output params which you need to modify. To return the results of a sys_refcursor you then need to declare a row type that is exactly equivalent to the select stmt / sys_refcursor being returned by the proc. Below I declare "type t_row" which matches my output fields, then loop through the returned sys_refcursor. If t_row matches my sys_refcursor then it gets populated with each row of the sys_refcursor:
没有办法在 sqldeveloper 的数据网格中显示引用光标。
我们可以定义一个引用游标,调用SP,然后打印引用游标,然后数据将以平面文本模式打印在脚本输出窗口中,但不会打印在查询结果窗口中。
there are no way to display a refcursor in datagrid in sqldeveloper.
we can define a refcursor,call SP,then print refcursor,then data will be printed in Script output window in a plane text mode,but not in Query Result window.