DB2 Version 9.7 for Linux, UNIX, and Windows

TraceAPIList! CLI/ODBC configuration keyword

Specifies what APIs not to trace using the CLI trace facility. If you do not set the TraceAPIList! keyword, all APIs are traced.

To set the TraceAPIList! keyword in thedb2cli.ini file, issue the following command:
"db2 update cli cfg for section common using 'TRACEAPILIST!'API ID,API ID..."
where API ID is an integer that corresponds to the name of a CLI API. You can find the mapping between API names and IDs in the /sqllib/include/sqlcli1.h file, as shown in the following example:
#define  SQL_API_SQLALLOCHANDLE        1001
#define  SQL_API_SQLFREEHANDLE         1006
#define  SQL_API_SQLCLOSECURSOR        1003
#define  SQL_API_SQLENDTRAN            1005
#define  SQL_API_SQLCOLATTRIBUTE       6
#define  SQL_API_SQLGETSTMTATTR        1014
#define  SQL_API_SQLGETCONNECTATTR     1007
Note: To run this command, you must use double quotation marks around the full command and single quotation marks around the TRACEAPILIST! keyword.
The /sqllib/samples/cli/db2conn.c sample program depicts the behavior of different CLI connect APIs: SQLConnect, SQLDriverConnect, and SQLBrowseConnect. If you do not set the TraceAPIList! keyword, the CLI trace that is generated is similar to the following example:
[ Process: 4453, Thread: 47717036514016 ]
[ Date & Time:          06/26/2009 03:14:51.158736 ]
[ Product:              QDB2/LINUXX8664 DB2 v9.7.0.1 ]
[ Level Identifier:     08020107 ]
[ CLI Driver Version:   09.02.0000 ]
[ Informational Tokens: "DB2 v9.7.0.1","n090609","LINUXAMD6497","Fixpack 1" ]
[ Install Path:         
/view/mayprasa_db2_v97fp1_linuxamd64_n090609_trc42/vbs/INST ]
[ db2cli.ini Location:  /home/mayprasa/sqllib/cfg/db2cli.ini ]
[ CLI Driver Type:      IBM DB2 Application Runtime Client ]



SQLAllocHandle( fHandleType=SQL_HANDLE_ENV, hInput=0:0, 
phOutput=&00007fffb229a990 )
    ---> Time elapsed - 0 seconds

SQLAllocHandle( phOutput=0:1 )
    <--- SQL_SUCCESS   Time elapsed - +2.830000E-004 seconds

SQLSetEnvAttr( hEnv=0:1, fAttribute=SQL_ATTR_ODBC_VERSION, vParam=3, cbParam=0 )
    ---> Time elapsed - +4.300000E-005 seconds

SQLSetEnvAttr( )
    <--- SQL_SUCCESS   Time elapsed - +1.800000E-005 seconds

SQLAllocHandle( fHandleType=SQL_HANDLE_DBC, hInput=0:1,
phOutput=&00007fffb229a8e4 )
    ---> Time elapsed - +3.600000E-005 seconds

SQLAllocHandle( phOutput=0:1 )
    <--- SQL_SUCCESS   Time elapsed - +4.480000E-004 seconds

SQLConnect( hDbc=0:1, szDSN="sample", cbDSN=-3, szUID="", cbUID=-3, 
szAuthStr="", 
   cbAuthStr=-3 )
    ---> Time elapsed - +2.000000E-005 seconds
( DBMS NAME="DB2/LINUXX8664", Version="09.07.0001", Fixpack="0x28020107" )
( Application Codepage=819, Database  Codepage=1208, Database XML Codepage=1208, 
   Char Send/Recv Codepage=819, Graphic Send/Recv Codepage=1200, 
XML Send/Recv Codepage=1208 )

SQLConnect( )
    <--- SQL_SUCCESS   Time elapsed - +1.242704E+000 seconds
( DSN=""SAMPLE"" )
( UID=" " )
( PWD="" )
To prevent the SQLAllocHandle API from being traced, issue the following command:
"db2 update cli cfg for section common using 'TRACEAPILIST!' 1001"
where 1001 is the ID for SQLAllocHandle API. The CLI trace that is generated is similar to the following example:
[ Process: 5442, Thread: 47530732661472 ]
[ Date & Time:          06/26/2009 05:11:10.794067 ]
[ Product:              QDB2/LINUXX8664 DB2 v9.7.0.1 ]
[ Level Identifier:     08020107 ]
[ CLI Driver Version:   09.02.0000 ]
[ Informational Tokens: "DB2 v9.7.0.1","n090609","LINUXAMD6497","Fixpack 1" ]
[ Install Path:         
/view/mayprasa_db2_v97fp1_linuxamd64_n090609_trc42/vbs/INST ]
[ db2cli.ini Location:  /home/mayprasa/sqllib/cfg/db2cli.ini ]
[ CLI Driver Type:      IBM DB2 Application Runtime Client ]



SQLSetEnvAttr( hEnv=0:1, fAttribute=SQL_ATTR_ODBC_VERSION, vParam=3, cbParam=0 )
    ---> Time elapsed - 0 seconds

SQLSetEnvAttr( )
    <--- SQL_SUCCESS   Time elapsed - +2.200000E-005 seconds

SQLConnect( hDbc=0:1, szDSN="sample", cbDSN=-3, szUID="", cbUID=-3, szAuthStr="", 
   cbAuthStr=-3 )
    ---> Time elapsed - +4.850000E-004 seconds
( DBMS NAME="DB2/LINUXX8664", Version="09.07.0001", Fixpack="0x28020107" )
( Application Codepage=819, Database  Codepage=1208, Database XML Codepage=1208, 
   Char Send/Recv Codepage=819, Graphic Send/Recv Codepage=1200, 
XML Send/Recv Codepage=1208 )

SQLConnect( )
    <--- SQL_SUCCESS   Time elapsed - +1.156099E+000 seconds
( DSN=""SAMPLE"" )
( UID=" " )
( PWD="" )

SQLDisconnect( hDbc=0:1 )
    ---> Time elapsed - +4.400000E-005 seconds

SQLDisconnect( )
    <--- SQL_SUCCESS   Time elapsed - +1.197430E-001 seconds
Usage notes:
You must enable CLI TRACE to use the TraceAPIList! keyword.