A package is an object that contains control structures used to execute SQL statements.4 Packages are produced during distributed program preparation. The control structures can be thought of as the bound or operational form of SQL statements. All control structures in a package are derived from the SQL statements embedded in a single source program.
In this book, the term access plan is used in general for packages, procedures, functions, triggers, and programs or service programs that contain control structures used to execute SQL statements. For example, the description of the DROP statement says that dropping an object also invalidates any access plans that reference the object (see DROP). This means that any packages, procedures, functions, triggers, and programs or service programs containing control structures referencing the dropped object are invalidated.
An invalidated access plan will be implicitly rebuilt the next time its associated SQL statement is executed. For example, if an index is dropped that is used in an access plan for a SELECT INTO statement, the next time that SELECT INTO statement is executed, the access plan will be rebuilt.
A package can also be created by the QSQPRCED API. Packages created by the QSQPRCED API can only be used by the QSQPRCED API. They cannot be used at an application server through DRDA® protocols. For more information, see the i5/OS™ APIs information in the Programming category of the iSeries Information Center.
The QSQPRCED API is used by IBM eServer iSeries Access for Windows to create packages for caching SQL statements executed via ODBC, JDBC, SQLJ, OLD DB, and .NET interfaces.