Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

violates its associated pragma

user9359353Jul 19 2013 — edited Jul 19 2013

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.

This post has been answered by Sven W. on Jul 19 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 16 2013
Added on Jul 19 2013
4 comments
922 views