DB2 - Problem description
| Problem IC85232 | Status: Closed |
SQL0332N error received on SQLGetCursorName when executing CLI application using a DB2 Client from version 9.7.0.6 or 9.7.0.5 | |
| product: | |
DB2 FOR LUW / DB2FORLUW / A10 - DB2 | |
| Problem description: | |
Two scenarios may generate this symptom:
When connection string passed to SQLDirverConnect() contains an
invalid attribute that results only in a warning message
CLI004W. The connection to the database would be successful
with warning(SUCCESS_WITH_INFO), but several of the DB2 CLI APIs
may throw the -332 or CLI0118E error further down the
application logic.
The problem has been seen with SQLGetCursorName()
When attempting to access a DRDA nickname in a Federation Server
environment with trusted context connection enabled.
Though most of statements that access the nickname would be
successful, several of them may fail with the -332 error.
For example:
-DELETE FROM <nickname> WHERE (SELECT * FROM <nickname> FETCH
FIRST N ROWS ONLY)
-UPDATE <nickname> SET set_clause (NOTE: problem happens if
set_clause cannot be pushed down to remote)
-DELETE FROM <nickname> WHERE CURRENT OF <CURSOR NAME>
-UPDATE <nickname> SET set_clause WHERE CURRENT OF <CURSOR NAME>
When Wrong parameter are passed to SQLDriverConnect it does not
assign correct value to source codepage which results in
conversion error
From CLI traces
SQLGetCursorNameW( hStmt=1:1, pszCursor=&00aef244,
cbCursorMax=2374,pcbCursor=&00aefb94 )
---> Time elapsed - +8,320000E-004 seconds
SQLGetCursorNameW( )
<--- SQL_ERROR Time elapsed - +1,108400E-002 seconds
SQLFetch( hStmt=1:1 )
---> Time elapsed - +1,551000E-003 seconds
( Unretrieved error message="[IBM][CLI Driver][DB2/NT] SQL0332N
Character conversion from the source code page "0" to the target
code page "1202" is not supported." )
SQLFetch( )
<--- SQL_NO_DATA_FOUND Time elapsed - +2,558000E-003
seconds
Another known scenario is the error in SQLPrepareW.
The error happened for the select statement having a MBCS object
name.
The example of CLI trace.
SQLGetDiagRec( pszSqlState="01S00", pfNativeError=-99999,
pszErrorMsg="[IBM][CLI Driver] CLI0004W Invalid connection
string attribute. SQLSTATE=01S00", pcbErrorMsg=79 )
<--- SQL_SUCCESS Time elapsed - +7.030000E-004 seconds
SQLAllocStmt( hDbc=0:1, phStmt=&0fffffffffffd3b0 )
---> Time elapsed - +3.080000E-004 seconds
SQLAllocStmt( phStmt=1:1 )
<--- SQL_SUCCESS Time elapsed - +1.870000E-004 seconds
SQLPrepareW( hStmt=1:1, pszSqlStr="SELECT <MBCS column name>
from T1", cbSqlStr=-3 )
---> Time elapsed - +4.500000E-004 seconds
( StmtOut="" )"" )
SQLPrepareW( )
<--- SQL_ERROR Time elapsed - +3.090000E-004 seconds
SQLGetDiagField( fHandleType=SQL_HANDLE_STMT, hHandle=1:1,
iRecNumber=0, fDiag
Identifier=SQL_DIAG_NUMBER, pDiagInfo=&0fffffffffffcc74,
cbDiagInfoMax=4, pcbDiagInfo=<NULL pointer> )
---> Time elapsed - +5.900000E-005 seconds
SQLGetDiagField( pDiagInfo=1 )
<--- SQL_SUCCESS Time elapsed - +2.760000E-004 seconds
SQLGetDiagField( fHandleType=SQL_HANDLE_STMT, hHandle=1:1,
iRecNumber=6, fDiag
Identifier=SQL_DIAG_INTERNAL_DIAGNOSTICS,
pDiagInfo=&0fffffffffffcc70, cbDiagInfoMax=0, pcbDiagInfo=<NULL
pointer> )
---> Time elapsed - +3.900000E-005 seconds
SQLGetDiagField( pDiagInfo=-1 )
<--- SQL_SUCCESS Time elapsed - +2.780000E-004 seconds
SQLGetDiagRec( fHandleType=SQL_HANDLE_STMT, hHandle=1:1,
iRecNumber=1, pszSqlS
tate=&0fffffffffffcc64, pfNativeError=&0fffffffffffcc6c,
pszErrorMsg=&0fffffffffffcd00, cbErrorMsgMax=1024,
pcbErrorMsg=&0fffffffffffcc60 )
******** | |
| Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * All user prior to v10 fp2 * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to version v10 fix pack 2 * **************************************************************** | |
| Local Fix: | |
| available fix packs: | |
DB2 Version 10.1 Fix Pack 1 for Linux, UNIX, and Windows | |
| Solution | |
| Workaround | |
not known / see Local fix | |
| Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 10.07.2012 01.11.2012 01.11.2012 |
| Problem solved at the following versions (IBM BugInfos) | |
| Problem solved according to the fixlist(s) of the following version(s) | |
| 10.1.0.1 |
|
| 10.5.0.1 |
|