SQL>
SQL>
SQL> CREATE OR REPLACE PACKAGE valerr
2 IS
3 FUNCTION get RETURN VARCHAR2;
4 END valerr;
5 /
Package created.
SQL>
SQL>
SQL> CREATE OR REPLACE PACKAGE BODY valerr
2 IS
3 v VARCHAR2(1) := 'ABC';
4
5 FUNCTION get RETURN VARCHAR2
6 IS
7 BEGIN
8 RETURN v;
9 END;
10 BEGIN
11 DBMS_OUTPUT.PUT_LINE ('Before I show you v...');
12
13 EXCEPTION
14 WHEN OTHERS
15 THEN
16 DBMS_OUTPUT.PUT_LINE ('Trapped the error!');
17
18 END valerr;
19 /
Package body created.
SQL>
SQL>
|