DB2 - Problem description
Problem IC65494 | Status: Closed |
A CLI TRACE FAILS TO DISPLAY THE CONTENTS OF THE APPLICATION BUF FER IF THE COLUMN OR PARAMETER WAS BOUND WITH A CBVALUEMAX OF 0 | |
product: | |
DB2 FOR LUW / DB2FORLUW / 910 - DB2 | |
Problem description: | |
When taking a CLI trace of an application, the application buffer holding the column value or parameter marker value may be empty if the application sets the cbValueMax value to 0. For example, the following CLI trace snippet shows the problem: [11/18/2009 18:51:11.702023] SQLBindParameter( hStmt=1:1, iPar=1, fParamType=SQL_PARAM_INPUT, fCType=SQL_C_CHAR, fSQLType=SQL_CHAR, cbColDef=3, ibScale=0, rgbValue=&0012fb18, cbValueMax=3, pcbValue=&0012ff68 ) [11/18/2009 18:51:11.719392] ---> Time elapsed - +1.720000E-003 seconds [11/18/2009 18:51:11.721445] SQLBindParameter( ) [11/18/2009 18:51:11.723404] <--- SQL_SUCCESS Time elapsed - +2.138100E-002 seconds [11/18/2009 18:51:11.725410] SQLBindParameter( hStmt=1:1, iPar=2, fParamType=SQL_PARAM_INPUT, fCType=SQL_C_CHAR, fSQLType=SQL_CHAR, cbColDef=3, ibScale=0, rgbValue=&0012fb14, cbValueMax=0, pcbValue=&0012ff6c ) [11/18/2009 18:51:11.745735] ---> Time elapsed - +2.006000E-003 seconds [11/18/2009 18:51:11.747729] SQLBindParameter( ) [11/18/2009 18:51:11.749509] <--- SQL_SUCCESS Time elapsed - +2.409900E-002 seconds ................. [11/18/2009 18:51:11.751517] SQLExecute( hStmt=1:1 ) [11/18/2009 18:51:11.755183] ---> Time elapsed - +2.008000E-003 seconds [11/18/2009 18:51:11.756969] ( Package="SYSSH200 ", Section=4 ) [11/18/2009 18:51:11.762341] [11/18/2009 18:51:11.764467] ( Row=1, iPar=1, fCType=SQL_C_CHAR, rgbValue="ABC" - x'414243', pcbValue=-3, piIndicatorPtr=-3 ) [11/18/2009 18:51:11.777222] [11/18/2009 18:51:11.778995] ( Row=1, iPar=2, fCType=SQL_C_CHAR, rgbValue="" - x'', pcbValue=-3, piIndicatorPtr=-3 ) [11/18/2009 18:51:11.791185] In this case we have two parameters. The value in the first parameter shows up fine when the statement is executed, however the value in the second parameter does not show up fine. The application calls the SQLBindParameter() API with a cbValueMax value of 0 on the second parameter. When the statement is executed, the "rgbValue" shows up as empty string. This is not expected. | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * When taking a CLI trace of an application, the application * * buffer holding the column value or parameter marker value * * may be empty if the application sets the cbValueMax value to * * 0. * * * * For example, the following CLI trace snippet shows the * * problem: * * * * [11/18/2009 18:51:11.702023] SQLBindParameter( hStmt=1:1, * * iPar=1, fParamType=SQL_PARAM_INPUT, fCType=SQL_C_CHAR, * * fSQLType=SQL_CHAR, cbColDef=3, ibScale=0, * * rgbValue=&0012fb18, cbValueMax=3, pcbValue=&0012ff68 ) * * [11/18/2009 18:51:11.719392] ---> Time elapsed - * * +1.720000E-003 seconds * * * * * * [11/18/2009 18:51:11.721445] SQLBindParameter( ) * * [11/18/2009 18:51:11.723404] <--- SQL_SUCCESS Time elapsed - * * +2.138100E-002 seconds * * * * * * [11/18/2009 18:51:11.725410] SQLBindParameter( hStmt=1:1, * * iPar=2, fParamType=SQL_PARAM_INPUT, fCType=SQL_C_CHAR, * * fSQLType=SQL_CHAR, cbColDef=3, ibScale=0, * * rgbValue=&0012fb14, cbValueMax=0, pcbValue=&0012ff6c ) * * [11/18/2009 18:51:11.745735] ---> Time elapsed - * * +2.006000E-003 seconds * * * * * * [11/18/2009 18:51:11.747729] SQLBindParameter( ) * * [11/18/2009 18:51:11.749509] <--- SQL_SUCCESS Time elapsed - * * +2.409900E-002 seconds * * * * ................. * * * * * * [11/18/2009 18:51:11.751517] SQLExecute( hStmt=1:1 ) * * [11/18/2009 18:51:11.755183] ---> Time elapsed - * * +2.008000E-003 seconds * * [11/18/2009 18:51:11.756969] ( Package="SYSSH200 ", * * Section=4 ) * * [11/18/2009 18:51:11.762341] * * [11/18/2009 18:51:11.764467] ( Row=1, iPar=1, * * fCType=SQL_C_CHAR, rgbValue="ABC" - x'414243', pcbValue=-3, * * piIndicatorPtr=-3 ) * * [11/18/2009 18:51:11.777222] * * [11/18/2009 18:51:11.778995] ( Row=1, iPar=2, * * fCType=SQL_C_CHAR, rgbValue="" - x'', pcbValue=-3, * * piIndicatorPtr=-3 ) * * [11/18/2009 18:51:11.791185] * * * * In this case we have two parameters. The value in the first * * parameter shows up fine when the statement is executed, * * however the value in the second parameter does not show up * * fine. * * * * The application calls the SQLBindParameter() API with a * * cbValueMax value of 0 on the second parameter. When the * * statement is executed, the "rgbValue" shows up as empty * * string. * * * * This is not expected. * **************************************************************** * RECOMMENDATION: * * Upgrade to Version 9.1 Fix Pack 10. * **************************************************************** | |
Local Fix: | |
Set the cbValueMax to a value that coincides with the maximum length of the application buffer that holds (or will hold) the contents of the data instead of to a value of 0. | |
available fix packs: | |
DB2 Version 9.1 Fix Pack 10 for Linux, UNIX and Windows | |
Solution | |
Problem was first fixed in Version 9.1 Fix Pack 10. | |
Workaround | |
see Local Fix. | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 11.01.2010 16.06.2011 16.06.2011 |
Problem solved at the following versions (IBM BugInfos) | |
9.1.FP10 | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.1.0.10 |