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 | |
| 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 |
|