IBM Support

PI35656: ODBC DRIVER RETURNS RC100 SQL_NO_DATA FOUND WHEN REPEAT FUCNTION IS USED

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Message Broker ESQL generates a SQL statement with REPEAT
    function executing against DB2 z/OS and receives RC100
    (SQL_NO_DATA) message.
    
    Prior to RC100, the following warning is received:
    DB2 FOR OS/390}{ODBC DRIVER}{DSN11015} 
    DSNT404I SQLCODE = 203, WARNING:  THE QUALIFIED COLUMN NAME STOC
    K.STOCK_ID WAS RESOLVED USING A NON-UNIQUE OR UNEXPOSED NAME    
    DSNT418I SQLSTATE   = 01552 SQLSTATE RETURN CODE                
    DSNT415I SQLERRP    = DSNXORSO SQL PROCEDURE DETECTING ERROR    
    DSNT416I SQLERRD    = 0  0  16  1114369792  0  0 SQL DIAGNOSTIC 
    INFORMATION    
    DSNT416I SQLERRD    = X'00000000'  X'00000000'  X'00000010'  X'4
    X'426BEF00' X'00000000'  X'00000000' SQL DIAGNOSTIC INFORMATION
    ERRLOC=5:10:2'
    
    ADDITIONAL SYMPTOMS/KEYWORDS:
    ============================
    SQLCODE100
    

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: ODBC Driver returns SQLCODE +100        *
    *                      when REPEAT function is used in         *
    *                      vendor escape clause.                   *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When REPEAT function is used in vendor escape clause like
     fn REPEAT(EXPRESSION, INTEGER)}, ODBC driver parses the
    INTEGER value incorrectly. It causes application to return
    SQL_NO_DATA_FOUND and SQLCODE +100.
    
    The following example illustrates the problem:
    
    1. Create a table and populate the table as following:
       CREATE TABLE MYTABLE ( INT4 INTEGER NOT NULL,
                              CHR10 CHAR(10) );
       INSERT INTO MYTABLE (INT4, CHR10)
       VALUES (10, 'CHR10     ') ;
    
    2. Prepare a SELECT statement which contains
        fn REPEAT(EXPRESSION, INTEGER)}
    
       SELECT INT4 FROM MYTABLE
       WHERE INT4 = 10 AND
        fn REPEAT(CHR10, 2)} = 'CHR10     CHR10     ';
    
    3. Use SQLBindCol() to bind column INT4.
    
    4. Execute the SELECT statement.
    
    5. Run SQLFetch() and verify the result.
       Expected behavior:
              SQLFetch() returns 10 for column INT4 with
              RC = SQL_SUCCESS.
       Actual behavior:
              SQLFetch() returns RC = SQL_NO_DATA_FOUND.
              SQLGetDiagRec() returns SQLCODE +100.
    

Problem conclusion

  • The parsing for REPEAT function in vendor escape clause is
    corrected. Expected data is returned instead of SQLCODE100.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI35656

  • Reported component name

    DB2 ODBC/JDBC/S

  • Reported component ID

    5740XYR02

  • Reported release

    B17

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2015-02-24

  • Closed date

    2015-05-27

  • Last modified date

    2015-07-01

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

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

    UI27996 UI27997

Modules/Macros

  • DSNAOCLI DSNAOC0K DSNAOC0T DSNAOG0K DSNAOG0T DSNAOSDK
    

Fix information

  • Fixed component name

    DB2 ODBC/JDBC/S

  • Fixed component ID

    5740XYR02

Applicable component levels

  • RA17 PSY UI27996

       UP15/06/12 P F506

  • RB17 PSY UI27997

       UP15/06/12 P F506

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":"B17"}]

Document Information

Modified date:
03 March 2021