Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calling standalone procedure

FirstName_LastNameDec 22 2015 — edited Dec 22 2015

I am having this below code where I have one package pkg_1 which has 2 procedures pr1 and pr2(local). There is another standalone procedure pr2. I am invoking the procedure pr1 inside pkg_1 which inturn calls pr2. Ideally it would call the local pr2 inside the package. Is there anyway to call the standalone procedure pr2 ?

below is the code with the result  -

/* Formatted on 12/22/2015 6:51:59 PM (QP5 v5.256.13226.35510) */

CREATE OR REPLACE PACKAGE BODY pkg_1

AS

     PROCEDURE pr2

     IS

     BEGIN

          DBMS_OUTPUT.put_line( 'Inside pr2 package' );

     END;

     PROCEDURE pr1

     IS

     BEGIN

          DBMS_OUTPUT.put_line( 'Inside Package' );

          pr2;

     END;

END;

/* Formatted on 12/22/2015 6:52:03 PM (QP5 v5.256.13226.35510) */

CREATE OR REPLACE PROCEDURE pr2

IS

BEGIN

     DBMS_OUTPUT.put_line( 'StandAlone Procedure-2' );

END;

/* Formatted on 12/22/2015 6:52:11 PM (QP5 v5.256.13226.35510) */

BEGIN

     pkg_1.pr1;

END;

RESULT --

Inside Package

Inside pr2 package

This post has been answered by Karthick2003 on Dec 22 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 19 2016
Added on Dec 22 2015
3 comments
1,110 views