- "Accessible by" clause is used to declare a particular unit may be referenced only by given list of units.
- Anonymous block cannot be listed under "Accessible by" Clause, hence the units declared as "Accessible by" cannot be called dynamically.
- "Accessible by" declared units cannot be invoked from outside of database
CREATE OR replace PROCEDURE proc_for_sal_increment ( pin_empno NUMBER,
pin_pct NUMBER )
accessible BY (update_sal_wrapper)
AS
BEGIN
UPDATE emp
SET sal = ( sal ) + ( sal * pin_pct / 100 )
WHERE empno = pin_empno;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Unable to Update sal : '
|| SQLCODE);
END;
pin_pct NUMBER )
accessible BY (update_sal_wrapper)
AS
BEGIN
UPDATE emp
SET sal = ( sal ) + ( sal * pin_pct / 100 )
WHERE empno = pin_empno;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Unable to Update sal : '
|| SQLCODE);
END;
BEGIN
Proc_for_sal_increment(7698, 10);
END;
/
exec proc_for_sal_increment(7698, 10);
CREATE OR replace PROCEDURE Update_sal_wrapper
AS
BEGIN
Proc_for_sal_increment(7698, 10);
END;
/
exec update_sal_wrapper;
Proc_for_sal_increment(7698, 10);
END;
/
exec proc_for_sal_increment(7698, 10);
CREATE OR replace PROCEDURE Update_sal_wrapper
AS
BEGIN
Proc_for_sal_increment(7698, 10);
END;
/
exec update_sal_wrapper;