IBM Support

IC74014: SYS_CONNECT_BY_PATH FAILS WITH -901 WHEN VARCHAR2 COMPATIBILITY FEATURE IS NOT ENABLED.

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • On a database without the VARCHAR2 compatibility feature
    enabled, SYS_CONNECT_BY_PATH may fail at execution with the
    following error:
    
       SQL0901N  The SQL statement failed because of a non-severe
    system error.
       Subsequent SQL statements can be processed.  (Reason
    "sqlricc2 result type".)
       SQLSTATE=58004
    
    This will happen when the length of the first argument times two
    plus the length of the second argument exceeds 4000.  For
    example:
    
       CREATE TABLE connby ( name VARCHAR(2000), id INTEGER, pid
    INTEGER );
       SELECT SYS_CONNECT_BY_PATH( name, '/' )
          FROM connby START WITH id = 1 CONNECT BY PRIOR id = pid;
    
    The length of the first argument (name) is 2000, the length of
    second argument is 1: 2*2000+1 = 4001 > 4000.
    

Local fix

  • If possible, cast the first argument such that the combined
    length <= 4000.  Note that this may result in truncation of the
    result
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * On a database without the VARCHAR2 compatibility feature     *
    * enabled, SYS_CONNECT_BY_PATH may fail at execution with the  *
    * following error:                                             *
    *                                                              *
    * SQL0901N The SQL statement failed because of a non-severe    *
    * system error.                                                *
    * Subsequent SQL statements can be processed. (Reason          *
    * "sqlricc2 result type".)                                     *
    * SQLSTATE=58004                                               *
    *                                                              *
    * This will happen when the length of the first argument times *
    * two                                                          *
    * plus the length of the second argument exceeds 4000. For     *
    * example:                                                     *
    *                                                              *
    * CREATE TABLE connby ( name VARCHAR(2000), id INTEGER, pid    *
    * INTEGER );                                                   *
    * SELECT SYS_CONNECT_BY_PATH( name, '/' )                      *
    * FROM connby START WITH id = 1 CONNECT BY PRIOR id = pid;     *
    *                                                              *
    * The length of the first argument (name) is 2000, the length  *
    * of                                                           *
    * second argument is 1: 2*2000+1 = 4001 > 4000.                *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 Version 9.7 Fix Pack 4.                       *
    ****************************************************************
    

Problem conclusion

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

Temporary fix

  • If possible, cast the first argument such that the combined
    length <= 4000. Note that this may result in truncation of the
    result
    

Comments

APAR Information

  • APAR number

    IC74014

  • 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

    2011-01-20

  • Closed date

    2011-05-05

  • Last modified date

    2011-05-05

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

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

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSY

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC74014

Modified date: 05 May 2011