db2_get_option

PECL ibm_db2 >= 1.6.0
db2_get_option - Retrieves an option value for a statement resource or a connection resource
Manual
Code Examples

db2_get_option( resource$resource, string$option ): string|false

Retrieves the value of a specified option value for a statement resource or a connection resource.

Parameters

resource

A valid statement resource as returned from db2_prepare or a valid connection resource as returned from db2_connect or db2_pconnect.

option

A valid statement or connection options. The following new options are available as of ibm_db2 version 1.6.0. They provide useful tracking information that can be set during execution with db2_get_option.

Note:

Prior versions of ibm_db2 do not support these new options.

When the value in each option is being set, some servers might not handle the entire length provided and might truncate the value.

To ensure that the data specified in each option is converted correctly when transmitted to a host system, use only the characters A through Z, 0 through 9, and the underscore (_) or period (.).

userid

SQL_ATTR_INFO_USERID - A pointer to a null-terminated character string used to identify the client user ID sent to the host database server when using DB2 Connect.

Note:

DB2 for z/OS and OS/390 servers support up to a length of 16 characters. This user-id is not to be confused with the authentication user-id, it is for identification purposes only and is not used for any authorization.

acctstr

SQL_ATTR_INFO_ACCTSTR - A pointer to a null-terminated character string used to identify the client accounting string sent to the host database server when using DB2 Connect.

Note:

DB2 for z/OS and OS/390 servers support up to a length of 200 characters.

applname

SQL_ATTR_INFO_APPLNAME - A pointer to a null-terminated character string used to identify the client application name sent to the host database server when using DB2 Connect.

Note:

DB2 for z/OS and OS/390 servers support up to a length of 32 characters.

wrkstnname

SQL_ATTR_INFO_WRKSTNNAME - A pointer to a null-terminated character string used to identify the client workstation name sent to the host database server when using DB2 Connect.

Note:

DB2 for z/OS and OS/390 servers support up to a length of 18 characters.

The following table specifies which options are compatible with the available resource types:

Resource-Parameter Matrix Key Value Resource Type Connection Statement Result Set X X - X X - X X - X X -
userid SQL_ATTR_INFO_USERID
acctstr SQL_ATTR_INFO_ACCTSTR
applname SQL_ATTR_INFO_APPLNAME
wrkstnname SQL_ATTR_INFO_WRKSTNNAME

Return Values

Returns the current setting of the connection attribute provided on success or false on failure.

Related Functions

Example of db2_get_option

Show all examples for db2_get_option

PHP Version: