Create a package level variable
SQL>
SQL> create or replace
2 package variables as
3 g_public_number number := null;
4 procedure setPrivateNumber( p_num number );
5 procedure print_private_number;
6 end variables;
7 /
Package created.
SQL>
SQL> create or replace
2 package body variables as
3 myNumber number := null;
4
5 procedure setPrivateNumber( p_num number ) is
6 begin
7 myNumber := p_num;
8 end setPrivateNumber;
9
10 procedure print_private_number is
11 begin
12 dbms_output.put_line( nvl(to_char(myNumber),'null' ) );
13 end print_private_number;
14
15 end variables;
16 /
Package body created.
SQL>
Related examples in the same category