Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
for other oracle users run the program

For other oracle users run the program

DML on any table or view used by the function. In a RAC envi‐ronment, each instance has its own result cache, which may differ in which items are cached, but common items in differ‐ent instances will never disagree with each other.

Whenever a result-cached function is called with new parame‐ters, both the parameters and the return value are saved in the cache. When the result-cached function is called with cached parameters, whether from your session or from a different one, the results are returned from the cache instead of being calcula‐ted anew. These cached entries can be monitored with the V$RESULT_CACHE% series of data dictionary views. Tune the size and usage of the result cache with the RESULT_CACHE_SIZE and RESULT_CACHE_MODE initial‐ization parameters and the DBMS_RESULT_CACHE built-in package.

• Defined with any OUT or IN OUT parameters

• Defined with any IN parameters of type BLOB, CLOB, NCLOB, REF CURSOR, object, or record

Stored Procedures and Functions | 117

CREATE OR REPLACE FUNCTION factorial(n NUMBER) RETURN NUMBER RESULT_CACHE IS
BEGIN
IF n <= 1 THEN
RETURN 1;
ELSE
RETURN n*factorial(n-1);
END IF;
END;

For packaged functions, use the keyword RESULT_CACHE in both the package specification and the package body:

An Oracle user who creates a stored program will be able to execute that program unless nondefault privileges are in place. For other Oracle users to run the program, they would, at a minimum, need to be granted EXECUTE permission on it. This permission can be received via direct grant to the user, or via a grant to a database role that has been granted to the user.

When a user executes a stored procedure, Oracle has to evalu‐ate whether the user has permissions on the underlying objects

118 |

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Divit Deshmukh

PageId: ELIDCDBA1D