I'm looking into some vendor-created code so that I can make a change, and the packaged function I want to change is declared as
CREATE OR REPLACE package util as
operation_name varchar2(30) := null;
function get_operation_name return varchar2;
procedure set_operation_name ( oper_name varchar2 );
pragma restrict_references (get_operation_name, WNDS);
pragma restrict_references (set_operation_name, WNDS);
FUNCTION get_operation_name return varchar2 is
return nvl(pacepack.operation_name,' ');
PROCEDURE set_operation_name ( oper_name varchar2 ) as
pacepack.operation_name := oper_name;
We use the value of operation_name to partially bypass the contents of triggers, to avoid edits when we want to strong-arm the data:
if get_operation_name = 'BYPASS' THEN
The vendor created this a long time ago, and seems unsure as to why it was there in the first place. I've been reading the documentation, and I'm still unsure myself.
It sounds like the only time we need to actually have restrict_references in place is if we're going to reference a function directly in a SQL statement, and that function writes to the database (WNDS). Since we aren't using the above in that fashion, can someone think of why we might need this proagma still?