Database Reference
In-Depth Information
12 commit;
13 end;
14 /
Procedure created.
The important new information is in line 2: the new accessible-by clause defines that only stored units within the
package input_api_interface_pkg can invoke the procedure debug_proc . Failing to do so will cause a runtime error:
SQL> exec debug_proc('test')
BEGIN debug_proc('test'); END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00904: insufficient privilege to access object DEBUG_PROC
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
This is quite clear: you do not have the rights to invoke debug_proc from outside the package. You can of course
reference more than one possible invoker in the accessible by clause separated by comma.
SQL> create or replace procedure debug_proc
2 accessible by (f_1,p_2,pkg_3,pkg_4)
3 as
4 begin
5 dbms_output.put_line('invoker() has been called');
6 end;
7 /
The stored units referenced in the accessible by clause do not need to exist at the time of the object's creation.
You cannot however define white lists within packages. Trying to do so will result in an error:
SQL> create or replace package pkg_3 as
2 procedure pkg_3_p1 accessible by (pkg_4);
3 end;
4 /
Warning: Package created with compilation errors.
SQL> show err
Errors for PACKAGE PKG_3:
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 PLS-00157: Only schema-level programs allow ACCESSIBLE BY
Search WWH ::




Custom Search