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.
About this task
To rebind a package, other than a trigger package, use the REBIND subcommand. To rebind a trigger package, use the REBIND TRIGGER PACKAGE subcommand. You can change any of 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 |
REBIND PACKAGE(SNTERSA.GROUP1.PROGA.(V1)) ENABLE(CICS,REMOTE)
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 (*.*.(*))
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.*.(*))
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.())