IBM Support

PI58251: SQLSTATE=22005 WHEN BINDING SQL_C_CHAR TO SQL_DECIMAL WITH PCBVALUE SET TO NULL

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • SQLExecute() failed with SQLSTATE=22005 when binding SQL_C_CHAR
    to SQL_DECIMAL with pcbValue set to NULL, while the previous
    parameter marker was bound to a numerical column with pcbValue
    set to SQL_NULL_DATA.
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: All users of DB2 Version 10 and              *
    *                 DB2 Version 11 for z/OS ODBC/CLI driver      *
    ****************************************************************
    * PROBLEM DESCRIPTION: SQLSTATE 22005 is issued when binding   *
    *                      non-EBCDIC SQL_C_CHAR data to           *
    *                      SQL_DECIMAL with pcbValue set to NULL.  *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    In a non-EBCDIC ODBC application,
    SQLExecute() failed with SQLSTATE=22005 when binding
    SQL_C_CHAR to SQL_DECIMAL with pcbValue set to NULL,
    while the previous parameter marker was bound to a numerical
    column with pcbValue set to SQL_NULL_DATA.
    
    The following example illustrates the problem:
    
    1. Set CURRENTAPPENSCH=UNICODE in the ODBC INI file.
    
    2. Create a table with two columns as following:
       CREATE TABLE USER01.TB59303 (COL1 INTEGER, COL2 DEC(31, 6))
    
    3. Call SQLPrepare() to prepare an SQL statement as following:
       INSERT INTO USER01.TB59303 VALUES(?, ?)
    
    4. Call SQLBindParamter() to bind both columns with C data type
       SQL_C_CHAR.  Set the length of input data for the first
       column to SQL_NULL_DATA and set the pcbValue argument for
       the second column to NULL.
    
    5. Call SQLExecute().
       Application failed with SQLSTATE 22005.
    

Problem conclusion

  •  Code has been modified to correctly process non-EBCDIC data
     bound to parameter marker of SQL type SQL_DECIMAL.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI58251

  • Reported component name

    DB2 ODBC/JDBC/S

  • Reported component ID

    5740XYR02

  • Reported release

    A17

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-02-29

  • Closed date

    2016-05-05

  • Last modified date

    2016-06-02

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    UI37601 UI37602

Modules/Macros

  •    DSNAOCLI DSNAOC0U DSNAOC22 DSNAOG0U DSNAOG22
    DSNAOSDK
    

Fix information

  • Fixed component name

    DB2 ODBC/JDBC/S

  • Fixed component ID

    5740XYR02

Applicable component levels

  • RA17 PSY UI37601

       UP16/05/23 P F605

  • RB17 PSY UI37602

       UP16/05/23 P F605

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEPEK","label":"Db2 for z\/OS"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A17"}]

Document Information

Modified date:
05 March 2021