IBM Support

IC65010: SYSIBM.INSERT AND SYSIBM.OVERLAY SCALAR FUNCTIONS RETURN SQL0138N, IF LENGTH>LENGTH(SOURCE-STRING)-START+1.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The scalar functions SYSIBM.INSERT and SYSIBM.OVERLAY do not
    allow a length argument that is greater than the length of the
    string-expression - start + 1.
    This behaviour is incompatible with SYSFUN.INSERT, and exisitng
    applications might fail with SQL0138N.
    For example:
    
    $ db2 values INSERT('12345', 3, 4, 'abc')
    
    1
    --------
    SQL0138N  A numeric argument of a built-in string function is
    out of range.
    SQLSTATE=22011
    
    As SYSIBM.OVERLAY works as the same manner as SYSIBM.INSERT,
    OVERLAY  also needs to be changed.SYSIBM.INSERT and
    SYSIBM.OVERLAY will allow any 0 < length < 2147483647 (maximum
    positive INTEGER value), if it means that it is beyond the end
    of source-string, we will replace everything starting at "start"
    position.
    

Local fix

  • Please use SYSFUN.INSERT instead of SYSIBM.INSERT (default in
    v9.5 or later).
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Users who use SYSIBM.INSERT or SYSIBM.OVERLAY scalar         *
    * functions.                                                   *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * The scalar functions SYSIBM.INSERT and SYSIBM.OVERLAY do not *
    * allow a length argument that is greater than the length of   *
    * the string-expression - start + 1.                           *
    * This behaviour is incompatible with SYSFUN.INSERT, and       *
    * exisitng applications might fail with SQL0138N.              *
    * For example:                                                 *
    *                                                              *
    * $ db2 values INSERT('12345', 3, 4, 'abc')                    *
    *                                                              *
    * 1                                                            *
    * --------                                                     *
    * SQL0138N  A numeric argument of a built-in string function   *
    * is out of range.                                             *
    * SQLSTATE=22011                                               *
    *                                                              *
    * As SYSIBM.OVERLAY works as the same manner as SYSIBM.INSERT, *
    * OVERLAY  also needs to be changed.SYSIBM.INSERT and          *
    * SYSIBM.OVERLAY will allow any 0 < length < 2147483647        *
    * (maximum positive INTEGER value), if it means that it is     *
    * beyond the end of source-string, we will replace everything  *
    * starting at "start" position.                                *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Please upgrade to version 9.7 fixpack 2 or later.            *
    ****************************************************************
    

Problem conclusion

  • Problem was first fixed in Version 9.7 Fix Pack 2.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC65010

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-12-07

  • Closed date

    2010-09-02

  • Last modified date

    2010-09-02

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

    IC64994

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

Modules/Macros

  • ENG_SQRI
    

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSEPGG","label":"DB2 for Linux, UNIX and Windows"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.7","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
02 September 2010