如何使用Toad工具显示sys_refcursor输出pl sql [英] How to display sys_refcursor output pl sql with Toad tool
问题描述
我写了一个查询来执行SP.执行工作与此很好.但是,我看不到输出结果.
I have written a query to execute the SP. The execution works fine with this. However, I'm not able to see output results.
declare v_rc sys_refcursor;
begin
SUSER.TRANS_REP (v_rc ,'Investments Series','31-12-2012','Dealer Group','All Adv') ;
end;
如何使用sys_refcursor显示输出结果.请帮忙.
How to display output result with sys_refcursor. Please help.
注意:我试图打印光标,但没有得到任何帮助.另请参阅此(如何在TOAD的DataGrid 和 https://community.oracle.com/thread/627571 ),但仍然没有帮助.
note: I tried to print cursor but did not get any help. Also refered this (How to display a sys_refcursor data in TOAD's DataGrid and https://community.oracle.com/thread/627571), but still no help.
推荐答案
在SQL*Plus
中,您可以使用 refcursor 变量轻松地做到这一点.
In SQL*Plus
you could easily do it using a refcursor variable.
SQL> var r refcursor
SQL>
SQL> BEGIN
2 OPEN :r FOR SELECT empno,ename FROM emp;
3 END;
4 /
PL/SQL procedure successfully completed.
SQL> print r
EMPNO ENAME
---------- ----------
7369 SMITH
7499 ALLEN
7521 WARD
7566 JONES
7654 MARTIN
7698 BLAKE
7782 CLARK
7788 SCOTT
7839 KING
7844 TURNER
7876 ADAMS
EMPNO ENAME
---------- ----------
7900 JAMES
7902 FORD
7934 MILLER
14 rows selected.
SQL>
我猜在TOAD中,您有某种输出选项.选择要在输出中查看值的变量,ref游标结果集将在其他窗口中打开.
I guess in TOAD, you have some sort of output options. Select the variables you want to see the values in the output, the ref cursor result set would open in a different window.
这篇关于如何使用Toad工具显示sys_refcursor输出pl sql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!