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
Code:
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
    begin
      return nvl(pacepack.operation_name,' ');
    end;
...
  PROCEDURE set_operation_name ( oper_name varchar2 ) as
  begin
     pacepack.operation_name := oper_name;
  end set_operation_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:
Code:
...
if get_operation_name = 'BYPASS' THEN
    SKIP
else
    DO
end if;
...
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?

Thanks,
Chuck