简体   繁体   English

Oracle:在包内调用存储过程

[英]Oracle: Call stored procedure inside the package

I'm not much in Oracle. 我在Oracle中并不多。 I use PL/SQL Developer. 我使用PL / SQL Developer。

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. 我不知道如何从PL / SQL Developer环境调用它。 I've tried this: 我试过这个:

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. 如您所见,我有2个输入和1个输出参数。 I want to print out output parameter. 我想打印出输出参数。 That's all. 就这样。

Thanks in advance for help. 在此先感谢您的帮助。

Goran 戈兰

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;

To those that are incline to use GUI: 对那些倾向于使用GUI的人:

Click Right mouse button on procecdure name then select Test 在程序名称上单击鼠标右键,然后选择“ Test

在此输入图像描述

Then in new window you will see script generated just add the parameters and click on Start Debugger or F9 然后在新窗口中,您将看到生成的脚本只需添加参数并单击Start DebuggerF9

在此输入图像描述

Hope this saves you some time. 希望这能为您节省一些时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM