Use EXEC to call a procedure in a package : EXEC « Function Procedure Packages « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> CREATE OR REPLACE PACKAGE calc_pkg
  2  IS
  3     PROCEDURE calculate_totals;
  4  END calc_pkg;
  5  /

Package created.

SQL>
SQL> CREATE OR REPLACE PACKAGE BODY calc_pkg
  2  IS
  3     PROCEDURE calculate_totals
  4     IS
  5     BEGIN
  6        RAISE VALUE_ERROR;
  7     EXCEPTION
  8        WHEN OTHERS
  9        THEN
 10           DBMS_OUTPUT.put_line('Current line number '|| $$plsql_line);
 11           DBMS_OUTPUT.put_line('Failed in program '|| $$plsql_unit);
 12     END calculate_totals;
 13  END calc_pkg;
 14  /

Package body created.

SQL>
SQL> EXEC calc_pkg.calculate_totals;

PL/SQL procedure successfully completed.

SQL>








27.23.EXEC
27.23.1.Demmonstrate the creation and execution of a simple PL/SQL procedure.
27.23.2.Use EXEC to call a procedure in a package