Rebinding a package
You need to rebind a package when you make changes that affect the package but that do not involve changes to the SQL statements. For example, if you create a new index, you need to rebind the package. If you change the SQL, you need to use the BIND PACKAGE command with the ACTION(REPLACE) option.
Before you begin
Procedure
To rebind packages other than trigger packages:
Use the REBIND PACKAGE subcommand.
You can change any of the bind options for a package when you rebind it.
The following table clarifies which packages are bound, depending on how you specify collection-id (coll-id), package-id (pkg-id), and version-id (ver-id) on the REBIND PACKAGE subcommand.
REBIND PACKAGE does not apply to packages for which you do not have the BIND privilege. An asterisk (*) used as an identifier for collections, packages, or versions does not apply to packages at remote sites.
Input | Collections affected | Packages affected | Versions affected |
---|---|---|---|
|
all | all | all |
|
all | all | all |
|
all | all | all |
|
all | all | ver-id |
|
all | all | empty string |
|
coll-id | all | all |
|
coll-id | all | all |
|
coll-id | all | ver-id |
|
coll-id | all | empty string |
|
coll-id | pkg-id | all |
|
coll-id | pkg-id | empty string |
|
coll-id | pkg-id | empty string |
|
coll-id | pkg-id | ver-id |
|
all | pkg-id | all |
|
all | pkg-id | empty string |
|
all | pkg-id | empty string |
|
all | pkg-id | ver-id |
Examples
- Example: Rebinding a package at a remote location
- The following example shows the options for rebinding a package at the remote location. The location name is SNTERSA. The collection is GROUP1, the package ID is PROGA, and the version ID is V1. The connection types shown in the REBIND subcommand replace connection types that are specified on the original BIND subcommand.
REBIND PACKAGE(SNTERSA.GROUP1.PROGA.(V1)) ENABLE(CICS,REMOTE)
- Example: Rebinding all local packages
- You can use the asterisk on the REBIND subcommand for local packages, but not for packages at remote sites. Any of the following commands rebinds all versions of all packages in all collections, at the local Db2 system, for which you have the BIND privilege.
REBIND PACKAGE (*) REBIND PACKAGE (*.*) REBIND PACKAGE (*.*.(*))
- Example: Rebinding all versions of all local packages
- Either of the following commands rebinds all versions of all packages in the local collection LEDGER for which you have the BIND privilege.
REBIND PACKAGE (LEDGER.*)
REBIND PACKAGE (LEDGER.*.(*))
- Example: Rebinding local packages in all collections
- Either of the following commands rebinds the empty string version of the package DEBIT in all collections, at the local Db2 system, for which you have the BIND privilege.
REBIND PACKAGE (*.DEBIT)
REBIND PACKAGE (*.DEBIT.())