Oracle:调用包内的存储过程
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13026016/
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
Oracle: Call stored procedure inside the package
提问by tesicg
I'm not much in Oracle. I use PL/SQL Developer.
我对 Oracle 的了解不多。我使用 PL/SQL 开发人员。
I have the following package:
我有以下包:
create or replace package PKG1
as
procedure INIT
(
nRN in number,
nREC_TYPE in number,
nIDENT out number
);
I'm not sure how to call it from PL/SQL Developer environment. I've tried this:
我不确定如何从 PL/SQL Developer 环境调用它。我试过这个:
DECLARE
procId NUMBER;
BEGIN
EXECUTE PKG1.INIT(1143824, 0, procId);
DBMS_OUTPUT.PUT_LINE(procId);
END;
But, there's an ORA-06550 (PLS-00103) error.
但是,存在 ORA-06550 (PLS-00103) 错误。
As you can see I have 2 input and 1 output parameter. I want to print out output parameter. That's all.
如您所见,我有 2 个输入和 1 个输出参数。我想打印输出参数。就这样。
Thanks in advance for help.
预先感谢您的帮助。
Goran
戈兰
回答by cagcowboy
You're nearly there, just take out the EXECUTE:
你快到了,只需取出 EXECUTE:
DECLARE
procId NUMBER;
BEGIN
PKG1.INIT(1143824, 0, procId);
DBMS_OUTPUT.PUT_LINE(procId);
END;
回答by Matas Vaitkevicius
To those that are incline to use GUI:
对于那些倾向于使用 GUI 的人:
Click Right mousebutton on procecdure name then select Test
单击Right mouse程序名称上的按钮,然后选择Test
Then in new window you will see script generated just add the parameters and click on Start Debugger
or F9
然后在新窗口中,您将看到生成的脚本,只需添加参数并单击Start Debugger
或F9
Hope this saves you some time.
希望这可以为您节省一些时间。