Home » SQL & PL/SQL » SQL & PL/SQL » pragma restrict_references
pragma restrict_references [message #230543] Thu, 12 April 2007 03:30 Go to next message
khushi2000
Messages: 29
Registered: April 2007
Junior Member
Hi,

Can we use pragma restrict_references option in function directly rather than in a package spec? IF yes, how? I was going through the forum. All i could see is that it is being defined in the pack spec.!!! Can this directive be used with the procedure as well?

khushi

Re: pragma restrict_references [message #230549 is a reply to message #230543] Thu, 12 April 2007 03:36 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Oracle answered this one for me:
SQL> CREATE FUNCTION mhe_restrict
  2  Return NUMBER
  3  Is
  4    PRAGMA RESTRICT_REFERENCES(mhe_restrict, 'WNDS');
  5  Begin
  6    Return 0;
  7  End;
  8  /

Warning: Function created with compilation errors.

SQL> sho err
Errors for FUNCTION MHE_RESTRICT:

LINE/COL ERROR
-------- -----------------------------------------------------------------
4/10     PLS-00708: Pragma RESTRICT_REFERENCES must be declared in a
         package specification


MHE
Re: pragma restrict_references [message #230552 is a reply to message #230543] Thu, 12 April 2007 03:39 Go to previous messageGo to next message
Michel Cadot
Messages: 68722
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
pragma restrict_references in a function is meaningless as you gave the name of the function in the statement.
This is why it is given outside function in the specification as it is part of its specification: your declare that a function as some purity qualities.

Btw, this instruction is useless since 8i (in almost cases).

Regards
Michel
Re: pragma restrict_references [message #230649 is a reply to message #230543] Thu, 12 April 2007 08:23 Go to previous messageGo to next message
michael_bialik
Messages: 621
Registered: July 2006
Senior Member
You don't specify pragma in stand-alone function.


Re: pragma restrict_references [message #230714 is a reply to message #230543] Thu, 12 April 2007 11:21 Go to previous message
khushi2000
Messages: 29
Registered: April 2007
Junior Member
Thanks...
Khushi
Previous Topic: help with pl/sql proc
Next Topic: inline query n lookup tables
Goto Forum:
  


Current Time: Thu Dec 12 05:19:48 CST 2024