Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> PL/SQL Pragma Restrict_References

PL/SQL Pragma Restrict_References

From: Magnus S. Petersen <magnus_at_post.olivant.fo>
Date: Sun, 17 Jan 1999 20:43:07 +0100
Message-ID: <36a24cbe.0@news.olivant.fo>


I have startet to rewrite many procedures, functions etc. by using packages, which generally speaking looks good, and works great.

I have several times come across violation of the purity level of functions declared in the specification of the packages. I usually give the functions a purity level of PRAGMA RESTRICT_REFERENCES(function_name,WNDS) and nothing more.
Very often there are no package variable but only variables inside the functions, so i cannot understand why there can be any violance of the purity level, when there are no variables in the package. I do not write to the database. As far as i have understood the WNDS asserts that the function does not modify any database tables WNPS asserts that the function does not modify any package variables, RNDS asserts that the function does not read any any database tables RNPS asserts that the function does not dead any package variables

For instance i have in a package one public function named IsPayments which by querying a database table returns a BOOLEAN value to indicate if there are any payments or not.
Another public function GetPayments which as a return value has a PL/SQL-table of records i.e. retreives the payment rows with a cursor and fills the pl/sql-table for the return.
Another function first calls the IsPayments function. If TRUE then the GetPayments function is called. Inside this last function a variable is declared with the same type as the returning value of the GetPayments function. I assign local_tbl:=GetPayments(parameter) So far the package compiles fine.
When i then use the following Local_var:= Local_tbl.Count the package will not compile and the error is < violates its associated pragma> It certainly does not write to any package variable Can anyone give me an explanation, as i seem to by stuck in this problem Regards Received on Sun Jan 17 1999 - 13:43:07 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US