IBM Support

PH31909: INSERT STATEMENT WITH TIMESTAMP FUNCTION TO INSERT INTO A VARCHAR/CHAR COLUMN MAY GET SQLCODE -408 INCORRECTLY RETURNED

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • An INSERT statement with a TIMESTAMP function to insert into a
    varchar/char column may get SQLCODE408 incorrectly returned.
    Such an INSERT should be allowed.
    For example:
    CREATE TABLE T1(C1 VARCHAR(45));
    COMMIT;
    INSERT INTO T1
    SELECT
    TIMESTAMP('2020-01-30-16.16.16.123456')
    FROM SYSIBM.SYSDUMMY1 ORDER BY 1;
    This may get SQLCODE -408 but it should be allowed.
    
    Additional Keywords:
    SQLINSERT SQLTIMESTAMP SQLCODEM408 SQLCODE408
    

Local fix

  • n/a
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All Db2 12 for z/OS users of INSERT                          *
    * statement.                                                   *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * Unexpected SQLCODE -408 could be                             *
    * issued for an SQL statement satisfying                       *
    * the following conditions:                                    *
    * 1. It is an INSERT from SELECT                               *
    *    statement.                                                *
    * 2. It is inserting a timestamp type                          *
    *    value to a character column.                              *
    * 3. There's a sort involved in select.                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Apply corrective PTF when available                          *
    ****************************************************************
    The following example could explain the detail:
    CREATE TABLE T1(C1 VARCHAR(45));
    INSERT INTO T1
    SELECT
    TIMESTAMP('2020-01-30-16.16.16.123456')
    FROM SYSIBM.SYSDUMMY1 ORDER BY 1;
    Db2 didn't handle the aforementioned INSERT statement
    correctly, so SQLCODE -408 could be issued for it.
    

Problem conclusion

  • Db2 is updated to handle the aforementioned INSERT statement
    correctly so the statement can be executed successfuly.
    Additional Keywords: SQLINSWSELECT SQLCODE408 SQLTIMESTAMP
                         SQLSELWINSERT SQLORDERBY SQLUNION
    

Temporary fix

Comments

APAR Information

  • APAR number

    PH31909

  • Reported component name

    DB2 OS/390 & Z/

  • Reported component ID

    5740XYR00

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2020-11-19

  • Closed date

    2020-12-24

  • Last modified date

    2021-01-04

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

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

    UI73307

Modules/Macros

  • DSNXODTV
    

Fix information

  • Fixed component name

    DB2 OS/390 & Z/

  • Fixed component ID

    5740XYR00

Applicable component levels

  • RC10 PSY UI73307

       UP21/01/01 P F012

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":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Platform":[{"code":"PF054","label":"z\/OS"}],"Version":"12.0"}]

Document Information

Modified date:
05 January 2021