Introduction to DB2 for z/OS
|
Previous topic |
Next topic |
Contents |
Glossary |
Contact z/OS |
PDF
Packages and application plans Introduction to DB2 for z/OS |
|
|
A package contains control structures that DB2® uses when it runs SQL statements. An application plan relates an application process to a local instance of DB2 and specifies processing options. Packages are produced during program preparation. You can think of the control structures as the bound or operational form of SQL statements. All control structures in a package are derived from the SQL statements that are embedded in a single source program. An application plan contains one or both of the following elements:
Most DB2 applications require an application plan. Packages make application programs more flexible and easier to maintain. For example, when you use packages, you do not need to bind the entire plan again when you change one SQL statement. Example: The following figure shows
an application plan that contains two packages. Suppose that you decide
to change the SELECT statement in package AA to select data from a
different table. In this case, you need to bind only package AA again
and not package AB.
In general, you create plans and packages by using the DB2 commands BIND PLAN and BIND PACKAGE. A trigger package is a special type of package that is created when you execute a CREATE TRIGGER statement. A trigger package executes only when the trigger with which it is associated is activated. Packages for JDBC, SQLJ, and ODBC applications serve different purposes that you can read more about later in this information. |
Copyright IBM Corporation 1990, 2010 |