Reference method from another package : Package Body « Function Procedure Packages « Oracle PL/SQL Tutorial






SQL>
SQL> CREATE OR REPLACE PACKAGE myPackage1
  2  IS
  3     PROCEDURE proc;
  4  END;
  5  /

Package created.

SQL> CREATE OR REPLACE PACKAGE BODY myPackage1
  2  IS
  3     PROCEDURE proc
  4     IS
  5     BEGIN
  6        NULL;
  7     END;
  8  END;
  9  /

Package body created.

SQL> CREATE OR REPLACE PACKAGE not_myPackage2
  2  IS
  3     PROCEDURE proc;
  4  END;
  5  /

Package created.

SQL> CREATE OR REPLACE PACKAGE BODY not_myPackage2
  2  IS
  3     PROCEDURE proc
  4     IS
  5     BEGIN
  6        NULL;
  7     END;
  8  END;
  9  /

Package body created.

SQL>
SQL> CREATE OR REPLACE PACKAGE myPackage
  2  IS
  3     PROCEDURE proc1;
  4     PROCEDURE proc2;
  5  END;
  6  /

Package created.

SQL>
SQL> CREATE OR REPLACE PACKAGE BODY myPackage
  2  IS
  3     PROCEDURE proc1
  4     IS
  5     BEGIN
  6        myPackage1.proc;
  7     END;
  8
  9     PROCEDURE proc2
 10     IS
 11     BEGIN
 12        not_myPackage2.proc;
 13     END;
 14  END;
 15  /

Package body created.

SQL>
SQL>








27.11.Package Body
27.11.1.Package with only one function
27.11.2.Package with two procedures
27.11.3.Package declaration and body
27.11.4.Use of 'get' and 'set' prefixes
27.11.5.Use package method in a procedure
27.11.6.Call function in a Package
27.11.7.Method overload
27.11.8.Package method overloading
27.11.9.Reference method from another package
27.11.10.Package Function with 'PRAGMA AUTONOMOUS_TRANSACTION'
27.11.11.Create a package containing stored procedure DELETE_ORDERS and stored function GET_employee_NAME.
27.11.12.Package initialization.
27.11.13.Use package member variable to pass value