DB2 Version 10.1 for Linux, UNIX, and Windows

sqle_client_info data structure

This structure is used to pass information to the sqleseti and sqleqryi APIs.

This structure specifies:
  • The type of information being set or queried
  • The length of the data being set or queried
  • A pointer to either:
    • An area that will contain the data being set
    • An area of sufficient length to contain the data being queried
Applications can specify the following types of information:
  • Client user ID being set or queried. A maximum of 255 characters can be set, although servers can truncate this to some platform-specific value.
    Note: This user ID is for identification purposes only, and is not used for any authorization.
  • Client workstation name being set or queried. A maximum of 255 characters can be set, although servers can truncate this to some platform-specific value.
  • Client application name being set or queried. A maximum of 255 characters can be set, although servers can truncate this to some platform-specific value.
  • Client current package path being set or queried. A maximum of 255 characters can be set, although servers can truncate this to some platform-specific value.
  • Client program ID being set or queried. A maximum of 80 characters can be set, although servers can truncate this to some platform-specific value.
  • Client accounting string being set or queried. A maximum of 200 characters can be set, although servers can truncate this to some platform-specific value.
    Note: The information can be set using the sqlesact API. However, sqlesact does not permit the accounting string to be changed once a connection exists, whereas sqleseti allows the accounting information to be changed for future, as well as already established, connections.
Table 1. Fields in the SQLE-CLIENT-INFO Structure
Field Name Data Type Description
TYPE sqlint32 Setting type.
LENGTH sqlint32 Length of the value. On sqleseti calls, the length can be between zero and the maximum length defined for the type. A length of zero indicates a null value. On sqleqryi calls, the length is returned, but the area pointed to by pValue must be large enough to contain the maximum length for the type. A length of zero indicates a null value.
PVALUE Pointer Pointer to an application-allocated buffer that contains the specified value. The data type of this value is dependent on the type field.
The valid entries for the SQLE-CLIENT-INFO TYPE element and the associated descriptions for each entry are listed in the following table:
Table 2. Connection Settings
Type Data Type Description
SQLE_CLIENT_INFO_USERID CHAR(255) The user ID for the client. Some servers may truncate the value. For example, DB2® for z/OS® servers support up to length 16. This user ID is for identification purposes only, and is not used for any authorization.
SQLE_CLIENT_INFO_WRKSTNNAME CHAR(255) The workstation name for the client. Some servers may truncate the value. For example, DB2 for z/OS servers support up to length 18.
SQLE_CLIENT_INFO_APPLNAME CHAR(255) The application name for the client. Some servers may truncate the value. For example, DB2 for z/OS servers support up to length 32.
SQLE_CLIENT_INFO_PROGRAMID CHAR(80) The program identifier for the client. Once this element is set, DB2 Universal Database for z/OS Version 8 associates this identifier with any statements inserted into the dynamic SQL statement cache. This element is only supported for applications accessing DB2 UDB for z/OS Version 8.
SQLE_CLIENT_INFO_ACCTSTR CHAR(200) The accounting string for the client. Some servers may truncate the value. For example, DB2 for z/OS servers support up to length 200.
SQLE_CLIENT_INFO_AUTOCOMMIT CHAR(1) The autocommit setting of the client. It can be set to SQLE_CLIENT_AUTOCOMMIT_ON or SQLE_CLIENT_AUTOCOMMIT_OFF.
Note: These field names are defined for the C programming language. There are similar names for FORTRAN and COBOL, which have the same semantics.

API and data structure syntax

SQL_STRUCTURE sqle_client_info
{
        unsigned short         type;
        unsigned short         length;
        char *pValue;
};

COBOL Structure

* File: sqlenv.cbl
01 SQLE-CLIENT-INFO.
    05 SQLE-CLIENT-INFO-ITEM OCCURS 4 TIMES.
        10 SQLE-CLIENT-INFO-TYPE   PIC S9(4) COMP-5.
        10 SQLE-CLIENT-INFO-LENGTH PIC S9(4) COMP-5.
        10 SQLE-CLIENT-INFO-VALUE  USAGE IS POINTER.
*