Using DB2 CLI Connection Attributes for DB2
This information can later be retrieved from DB2 special registers using SQL statements.
To enable this functionality in IBM Cognos BI, you must modify a configuration file on each IBM Cognos report server computer that is configured in your IBM Cognos environment. Because this functionality is set up at the query level, the information that is associated with the connection attributes is automatically updated every time that the report runs.
The following list shows the DB2 CLI connection attributes that can be changed by IBM Cognos BI, and the type of information that these attributes can pass to DB2:
- SQL_ATTR_INFO_USERID
Specifies the name of the user running a report.
- SQL_ATTR_INFO_WRKSTNNAME
Specifies the address of the system on which the user's browser is installed.
- SQL_ATTR_INFO_APPLNAME
Specifies the package name associated with the query. If the string is longer than 32 characters, it overflows to $SLOT2 in the accounting string.
- SQL_ATTR_INFO_ACCTSTR
Specifies the prefix or string that associates the request with IBM Cognos BI. The values are:
Table 1. Using DB2 CLI connection attributes for DB2 Value
Description
COG
Associates the request with IBM Cognos products in IBM Optim Integrated Data Management.
ccc
Associates the request with an IBM Cognos solution. For version 8.4, this is set to BI.
vr
Specifies the version of IBM Cognos product, such as 8.4.
Additional accounting information
This information is divided into the following fields (slots):
- $SLOT2 - $packageName (overflow section for $SLOT1)
- $SLOT3 - $reportName
- $SLOT4 - $queryName
- $SLOT5 - $reportPath
Each slot has a fixed length that accepts strings containing no more than 46 bytes, padded with blanks if necessary. Because report paths, model paths, and so on, are often long, the strings may be shortened to adjust to the space limitations.
Note: In DB2, values passed to the API cannot contain single quote characters, which are converted to spaces. If the character set encoding is using multiple bytes per character, the character is converted to "?" in order to avoid overflow. This is important where Unicode is used and a character may require more than 2 bytes.