Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IC62908 Status: Closed

CLI APPLICATION MIGHT FAIL WITH CLI0612E IF SQL STATEMENT INCLUDES
BLOCK COMMENT WITH NULTI-BYTE CHARACTERS.

product:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
Problem description:
DB2 CLI may fail to count number of parameter markers if SQL 
statements include comment(s) with multi-byte characters. CLI 
Application receives CLI0612E when it tries to bind a parameter 
to the parameter markers. 
The following steps illustrates one of the scenario to cause 
this problem. 
. 
1. We have following query includes Japanese comment string. 
. 
 select * from org 
 where 
  deprnumb = ? and 
  /*<4 Japanese Characters>*/ 
  manager = ? 
. 
2. Prepare the statement and set values by using Legacy JDBC 
   Driver. 
. 
 PreparedStatement stmt = conn.prepareStatement(sql); 
 stmt.setInt(1, 10); 
 stmt.setInt(2, 160); 
. 
3. Second setInt() fails with CLI0612E because SQLNumParams 
   reports the statement includes only one parameter marker, 
   and CLI thinks index 2 is out of range. 
. 
Exception: 
 COM.ibm.db2.jdbc.DB2Exception: IBM JDBC Driver CLI0612E 
 Invalid parameter number. SQLSTATE=S1093 
. 
CLI trace: 
 SQLPrepareW( hStmt=1:1, pszSqlStr="select * from org ...) 
 SQLPrepareW( ) 
    <--- SQL_SUCCESS 
 SQLNumParams( hStmt=1:1, pcPar=&0007fc48 ) 
 SQLNumParams( pcPar=1 )   // This should be 2. 
    <--- SQL_SUCCESS
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* Users who uses multi-bytes characters in SQL comments.       * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* DB2 CLI may fail to count number of parameter markers if SQL * 
*                                                              * 
* statements include comment(s) with multi-byte characters.    * 
* CLI                                                          * 
* Application receives CLI0612E when it tries to bind a        * 
* parameter                                                    * 
* to the parameter markers.                                    * 
* The SQL might fails with SQL0104N.                           * 
**************************************************************** 
* RECOMMENDATION:                                              * 
****************************************************************
Local Fix:
Please remove SQL comments which contains multi-byte characters.
available fix packs:
DB2 Version 9.7 Fix Pack 1 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 2 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 3 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 3a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 for Linux, UNIX, and Windows

Solution
Problem was first fixed in Version 9.7 Fixpack 1
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
01.09.2009
17.12.2009
17.12.2009
Problem solved at the following versions (IBM BugInfos)
9.7.FP1
Problem solved according to the fixlist(s) of the following version(s)
9.7.0.1 FixList