About stored program units About external PLSQL libraries

2-38 Oracle Reports Users Guide to Building Reports begin return salaryCostofLiving; end; Following are some examples of how you might reference the PLSQL function in formulas: CompSal:RGNSUMSAL or CompSal:SAL + COMM See also Section 4.13.3.1, Creating a local program unit

2.6.5 About stored program units

Stored program units also known as stored subprograms, or stored procedures can be compiled separately and stored permanently in an Oracle database, ready to be executed. Once compiled and stored in the data dictionary, they are schema objects, which can be referenced by any number of applications connected to that database. Stored program units offer higher productivity, better performance, memory savings, application integrity, and tighter security. For example, by designing applications around a library of stored procedures and functions, you can avoid redundant coding and increase your productivity. Stored program units are stored in parsed, compiled form. So, when called, they are loaded and passed to the PLSQL engine immediately. Also, they take advantage of shared memory. So, only one copy of a program unit need be loaded into memory for execution by multiple users. Because stored program units run in ORACLE, they can perform database operations more quickly than PLSQL that is local to your report. Therefore, in general, use stored program units for PLSQL that performs database operations. Use local program units for PLSQL that does not involve database operations. However, if you are on a heavily loaded network with very slow response time, using stored program units may not be faster for database operations. Similarly, if your server is significantly faster than your local machine, then using local program units may not be faster for non-database operations. See also Section 4.13.3.2, Creating a stored program unit

2.6.6 About external PLSQL libraries

External PLSQL libraries are collections of PLSQL procedures, functions, and packages that are independent of a report definition. By attaching an external library to a report, you can reference its contents any number of times. For example, you could reference a procedure in an attached library from both a Before Report trigger and a format trigger. This eliminates the need to re-enter the same PLSQL for each application. When you associate an external PLSQL library with a report or another external library, it is called an attached library. Advanced Concepts 2-39 See also Section 4.13.5.1, Creating an external PLSQL library

2.6.7 About attached libraries