Hi,
Please find below the example code
Oracle version 11.2.0.3.0
1. Package test which I've declared the global variable
CREATE OR REPLACE PACKAGE test IS
"TEST" CONSTANT BOOLEAN := TRUE;
END test;
2. Package sepcification
CREATE OR REPLACE PACKAGE test2 IS
FUNCTION m (
x IN VARCHAR2 ) RETURN NUMBER;
PRAGMA restrict_references(m, WNDS);
END test2;
3. Package Body
CREATE OR REPLACE PACKAGE BODY test2 IS
FUNCTION m(x IN VARCHAR2) RETURN NUMBER IS
b_ BOOLEAN;
BEGIN
b_ := TEST."TEST"; -- This is the place where I'm calling to the CONSTANT and the reason for the pragma violation
return 1;
END m;
END test2;
I'm wondering why I get this pragma violation error, I'm not changing any database state here.
I'm confused need help.
Thanks in advance and cheers,
Dark.