简体   繁体   中英

Oracle: Call stored procedure inside the package

I'm not much in Oracle. I use 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. 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.

As you can see I have 2 input and 1 output parameter. 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:

DECLARE
  procId NUMBER;

BEGIN
  PKG1.INIT(1143824, 0, procId);
  DBMS_OUTPUT.PUT_LINE(procId);
END;

To those that are incline to use GUI:

Click Right mouse button on procecdure name then select Test

在此输入图像描述

Then in new window you will see script generated just add the parameters and click on Start Debugger or F9

在此输入图像描述

Hope this saves you some time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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