IBM Support

PH52126: QUERY RECEIVES SQLCODE -312 FOR A MERGE STATEMENT WITH HOST VARIABLES WHEN BATCH NODE IS ENABLED WITH DB2JCC4 DRIVER

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When running a MERGE statement with host variables followed
    by an INSERT with host variables in batch, an SQLCODE312
    may occur with DB2Jcc4 Driver 4.31 and 4.29.29.
    Additional keywords:
    SQLHOSTVAR SQLINSERT SQLMERGE
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All Db2 12 and 13 for z/OS users of MERGE                    *
    * statement and host variable.                                 *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * SQLCODE -312 may be issued                                   *
    * incorrectly for a MERGE statement                            *
    * that contains a FOR n ROWS clause and                        *
    * references a host variable in the                            *
    * UPDATE clause.                                               *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Apply corrective PTF when available                          *
    ****************************************************************
    For Example,
    MERGE INTO T1
     USING (VALUES(:H1:H2) FOR :H3 ROWS) AS S1(CS1)
      ON C1  =   CS1
    WHEN MATCHED THEN
      UPDATE SET C1 = :H1:H2
    WHEN NOT MATCHED THEN
       INSERT (C1) VALUES (CS1)
    NOT ATOMIC CONTINUE ON SQLEXCEPTION;
    Db2 did not process the host variable in the UPDATE clause
    correctly when the MERGE statement contains the FOR n ROWS
    clause and that may cause an incorrect SQLCODE -312 to be
    issued.
    

Problem conclusion

  • Db2 was modified to fix the incorrect SQLCODE -312 for the
    aforementioned statement.
    Additional Keywords: SQLMERGE SQLUPDATE  SQLMULTIROW SQLMULTI
                       SQLCODE312
    

Temporary fix

  • *********
    * HIPER *
    *********
    

Comments

APAR Information

  • APAR number

    PH52126

  • Reported component name

    DB2 OS/390 & Z/

  • Reported component ID

    5740XYR00

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    YesHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2023-01-24

  • Closed date

    2023-04-07

  • Last modified date

    2023-05-03

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

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

    UI91331 UI91332

Modules/Macros

  • DSNXOST
    

Fix information

  • Fixed component name

    DB2 OS/390 & Z/

  • Fixed component ID

    5740XYR00

Applicable component levels

  • RC10 PSY UI91331

       UP23/04/15 P F304 ¢

  • RD10 PSY UI91332

       UP23/04/15 P F304 ¢

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.

[{"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":"12.0","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
03 May 2023