Bind Utility

The Bind utility enables you to create static SQL packages in a remote DB2 location accessed using DRDA, providing that the target location is registered appropriately at the DB2 Link gateway and that your AuthID has Bind authority at the target location.

The Bind Utility generates a static package in DB2 from the contents of a local database request module (DBRM). A package is a single, bound DBRM containing optimized access paths to data. A DBRM contains all the information needed to create a package in a remote database.

Every application that runs against DB2 (including XDB Link) must have an application package to support the execution of statically-bound and dynamic SQL contained in the program. You must create a default package for XDB Link for each DB2 location with which you want to use the Link. See the Link Configuration Guide for more information.

Use the Bind Utility if you are configuring the XDB Link and you are ready to create a default DBRM and package for the Link, or you used the Static Bind Administrator to generate a DBRM and package for your application and you would like to modify or drop the package.

Note:

You do not need to bind your application if you use the default SQL precompiler settings, as these enable Embedded SQL statements in your programs to be run dynamically against the remote system. Running Embedded SQL dynamically is useful in situations where you want to access remote DB2 data but do not want to keep rebinding your application as it changes; for example, while debugging the application. You can optionally change the precompiler settings to produce static SQL database request modules to bind the application for deployment purposes. For more information on the precompiler options, see the topic XDB Directive Options.

A package at a location is identified by a collection identifier, a program identifier, a version label and a consistency token. Typically, you would use the collection identifier as a way of grouping the packages used in a single application consisting of one or more programs. The precompiler creates a program identifier for a package from the root of the program filename. You can specify a version label or accept the default value (01). You do not have to specify a version label, because the current package can be identified from its consistency token, generated from a timestamp at the start of precompilation. Note that each time you recompile a DB2 application, the timestamp changes and you must rebind the application to the DB2 host location if you are using static SQL packages. An alternative approach to avoid having to rebind your application each time you compile it is to debug against data stored in an EBCDIC location on your personal XDB Server. You can then test it against mainframe data when you have achieved a satisfactory level of stability.

The Bind utility enables you to specify a number of options for an application, including a version number and the isolation level of the application. These options can be stored in a file for future use.