Skip Headers
Oracle® Database PL/SQL Language Reference
11g Release 2 (11.2)

Part Number E25519-05
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub
LNPLS01339

RESTRICT_REFERENCES Pragma

Note:

The RESTRICT_REFERENCES pragma is deprecated. Oracle recommends using DETERMINISTIC and PARALLEL_ENABLE (explained in "Function Declaration and Definition") instead of RESTRICT_REFERENCES.

The RESTRICT_REFERENCES pragma asserts that a user-defined subprogram does not read or write database tables or package variables. Subprograms that read or write database tables or package variables are difficult to optimize, because any invocation of the subprogram might produce different results or encounter errors.

LNPLS1796Restriction on RESTRICT_REFERENCES Pragma

This pragma can appear only in a package specification or ADT specification. Typically, this pragma is specified for functions. If a function invokes procedures, specify this pragma for those procedures also.

LNPLS1797Topics

Syntax

LNPLS1298restrict_references_pragma ::=

Description of restrict_references_pragma.gif follows
Description of the illustration restrict_references_pragma.gif

Semantics

LNPLS1300subprogram

Name of a user-defined subprogram, typically a function. If subprogram is overloaded, the pragma applies only to the most recent subprogram declaration.

LNPLS1672method

Name of a MEMBER subprogram (see "CREATE TYPE Statement", specifically "element_spec ::=").

LNPLS1301DEFAULT

Applies the pragma to all subprograms in the package specification or ADT specification (including the system-defined constructor for ADTs).

If you also declare the pragma for an individual subprogram, it overrides the DEFAULT pragma for that subprogram.

LNPLS1302RNDS

Asserts that the subprogram reads no database state (does not query database tables).

LNPLS1303WNDS

Asserts that the subprogram writes no database state (does not modify tables).

LNPLS1304RNPS

Asserts that the subprogram reads no package state (does not reference the values of package variables)

LNPLS1798Restriction on RNPS You cannot specify RNPS if the subprogram invokes the SQLCODE or SQLERRM function.

LNPLS1305WNPS

Asserts that the subprogram writes no package state (does not change the values of package variables).

LNPLS1799Restriction on WNPS You cannot specify WNPS if the subprogram invokes the SQLCODE or SQLERRM function.

LNPLS1306TRUST

Asserts that the subprogram can be trusted not to violate one or more rules.

When you specify TRUST, PL/SQL does not check the subprogram body for violations of the constraints listed in the pragma. Skipping these checks can improve performance. TRUST is needed for functions written in C or Java that are invoked from PL/SQL, since PL/SQL cannot verify them at run time.

Note:

To invoke a subprogram from parallel queries, you must specify all four constraints—RNDS, WNDS, RNPS, and WNPS. No constraint implies another.
Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF