PL/SQL Function Result Cache

You must create a PL/SQL function with a RESULT_CACHE clause to add its result to the PL/SQL function result cache. When a cache-enabled PL/SQL function is invoked for the first time, the database looks into the PL/SQL result cache for its result with the matching arguments. If the result is found, it is returned to the calling environment without executing the function body. If the result is not found, the function body is executed and the result is stored in the PL/SQL function cache. Upon subsequent function calls for the same input parameters, the result is fetched directly from the cache.

Note that a result cache function doesn't need the dependent database tables to be result-cached.

Note

Oracle Database 11g Release ...

Get Advanced Oracle PL/SQL Developer's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.