DB2 10.5 for Linux, UNIX, and Windows

db2cap - CLI/ODBC static package binding tool command

Binds a capture file to generate one or more static packages. A capture file is generated during a static profiling session of a CLI, ODBC, or .NET application, and contains SQL statements that were captured during the application run. This utility processes the capture file so that it can be used by the CLI, ODBC, or .NET driver to execute static SQL for the application.

Authorization

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-db2cap--+-----+--bind--capture-file-- -d--database_alias----->
           +- -h-+                                            
           '- -?-'                                            

>--+--------------------------------+--------------------------><
   '- -u--userid--+---------------+-'   
                  '- -p--password-'     

Command parameters

-h | -?
Displays help text for the command syntax.
bind capture-file
Binds the statements from the capture file and creates one or more packages. This capture file is also known as the pureQueryXML file for .NET.
-d database_alias
Specifies the database alias for the database that contains one or more packages.
-u userid
Specifies the user ID to be used to connect to the data source. If a user ID is not specified, a trusted authorization ID is obtained from the system.
-p password
Specifies the password to be used to connect to the data source.

Usage notes

This command must be entered in lowercase on UNIX platforms, but can be entered in either lowercase or uppercase on Windows operating systems. Static package binding for .NET applications is supported only on Windows operating systems.

This utility supports many user-specified bind options that can be found in the capture file. In order to change the bind options, open the capture file in a text editor.

The SQLERROR(CONTINUE) and the VALIDATE(RUN) bind options can be used to create a package.

When using this utility to create a package, static profiling must be disabled.

The number of packages created depends on the isolation levels used for the SQL statements that are recorded in the capture file. The package name consists of up to a maximum of the first seven characters of the package keyword from the capture file, and one of the following single-character suffixes:
  • 0 - Uncommitted Read (UR)
  • 1 - Cursor Stability (CS)
  • 2 - Read Stability (RS)
  • 3 - Repeatable Read (RR)
  • 4 - No Commit (NC)
To obtain specific information about packages, the user can:
  • Query the appropriate SYSIBM catalog tables using the COLLECTION and PACKAGE keywords found in the capture file.
  • View the capture file.