DB2 Version 9.7 for Linux, UNIX, and Windows

DescribeOutputLevel CLI/ODBC configuration keyword

Sets the level of output column describe information that is requested by the CLI driver during prepare or describe requests.

db2cli.ini keyword syntax:
DescribeOutputLevel = 0 | 1 | 2 | 3
Default setting:
Request the describe information listed in level 2 of Table 1.
Equivalent connection attribute:
SQL_ATTR_DESCRIBE_OUTPUT_LEVEL
Usage notes:
This keyword controls the amount of information the CLI driver requests on a prepare or describe request. By default, when the server receives a describe request, it returns the information contained in level 2 of Table 1 for the result set columns. An application, however, might not need all of this information or might need additional information. Setting the DescribeOutputLevel keyword to a level that suits the needs of the client application might improve performance because the describe data transferred between the client and server is limited to the minimum amount that the application requires. If the DescribeOutputLevel setting is set too low, it might impact the functionality of the application (depending on the application's requirements). The CLI functions to retrieve the describe information might not fail in this case, but the information returned might be incomplete. Supported settings for DescribeOutputLevel are:
  • 0 - no describe information is returned to the client application
  • 1 - describe information categorized in level 1 (see Table 1) is returned to the client application
  • 2 - (default) describe information categorized in level 2 (see Table 1) is returned to the client application
  • 3 - describe information categorized in level 3 (see Table 1) is returned to the client application

The following table lists the fields that form the describe information that the server returns when it receives a prepare or describe request. These fields are grouped into levels, and the DescribeOutputLevel CLI/ODBC configuration keyword controls which levels of describe information the CLI driver requests.

Note:
  1. Not all levels of describe information are supported by all DB2® servers. All levels of describe information are supported on the following DB2 servers: DB2 for Linux, UNIX, and Windows Version 8 and later, DB2 for z/OS® Version 8 and later, and DB2 for i5/OS™ Version 5 Release 3 and later. All other DB2 servers support only the 2 or 0 setting for DescribeOutputLevel.
  2. The default behavior allows CLI to promote the level to 3 if the application asks for describe information that was not initially retrieved using the default level 2. This might result in two network flows to the server. If an application uses this keyword to explicitly set a describe level, then no promotion will occur. Therefore, if the keyword is used to set the describe level to 2, CLI will not promote to level 3 even if the application asks for extended information.
Table 1. Levels of describe information
Level 1 Level 2 Level 3
SQL_DESC_COUNT
SQL_COLUMN_COUNT
SQL_DESC_TYPE
SQL_DESC_CONCISE_TYPE
SQL_COLUMN_LENGTH
SQL_DESC_OCTET_LENGTH
SQL_DESC_LENGTH
SQL_DESC_PRECISION
SQL_COLUMN_PRECISION
SQL_DESC_SCALE
SQL_COLUMN_SCALE
SQL_DESC_DISPLAY_SIZE
SQL_DESC_NULLABLE
SQL_COLUMN_NULLABLE
SQL_DESC_UNSIGNED
SQL_DESC_SEARCHABLE
SQL_DESC_LITERAL_SUFFIX
SQL_DESC_LITERAL_PREFIX
SQL_DESC_CASE_SENSITIVE
SQL_DESC_FIXED_PREC_SCALE
all fields of level 1 and:
SQL_DESC_NAME
SQL_DESC_LABEL
SQL_COLUMN_NAME
SQL_DESC_UNNAMED
SQL_DESC_TYPE_NAME
SQL_DESC_DISTINCT_TYPE
SQL_DESC_REFERENCE_TYPE
SQL_DESC_STRUCTURED_TYPE
SQL_DESC_USER_TYPE
SQL_DESC_LOCAL_TYPE_NAME
SQL_DESC_USER_DEFINED_
         TYPE_CODE
all fields of levels 1
and 2 and:
SQL_DESC_BASE_COLUMN_NAME
SQL_DESC_UPDATABLE
SQL_DESC_AUTO_UNIQUE_VALUE
SQL_DESC_SCHEMA_NAME
SQL_DESC_CATALOG_NAME
SQL_DESC_TABLE_NAME
SQL_DESC_BASE_TABLE_NAME