如何使用 squirrel 在 Oracle 中使用引用游标调用存储过程

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2638552/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 02:31:33  来源:igfitidea点击:

How to call a stored procedure using a ref cursor in Oracle with squirrel

oracleref-cursorsquirrel-sql

提问by rapdum

I'm trying to do the same request I'm using in Toad

我正在尝试执行在 Toad 中使用的相同请求

(the stored procedure signature is two varchar2 parameter and one REF CURSOR parameter)

(存储过程签名是两个 varchar2 参数和一个 REF CURSOR 参数)

Here is what I do with Toad

这是我用蟾蜍做的事情

variable myCursor refcursor;
EXEC myproc('param1','param2',:myCursor );
print myCursor;

I don't know how to write this with Squirrel and I have to use Squirrel.

我不知道如何用 Squirrel 写这个,我必须使用 Squirrel。

Thanks a lot for your response

非常感谢您的回复

Rapha?l

拉斐尔

回答by dovka

The only syntax I get working in Squirrel SQL is PL/SQL block:

我在 Squirrel SQL 中使用的唯一语法是PL/SQL 块:

declare
v_param1  varchar2:='param';
v_param2  varchar2:='param';
TYPE ref_cursor IS REF CURSOR;
v_cur_results ref_cursor;
begin
MyProc (v_param1  , v_param2 , v_cur_results)
end;
/

回答by Kevin Burton

If the tool does not support this facility the next best thing would be to create a proc that will output your cursor for you.

如果该工具不支持此功能,那么下一个最好的方法是创建一个可以为您输出光标的过程。

Luckly it has already been written for you. see rc_to_dbms_sql( in http://www.oracle-developer.net/display.php?id=505

幸运的是,它已经为你写好了。参见 rc_to_dbms_sql( 在 http://www.oracle-developer.net/display.php?id=505