IBM Support

IC75127: SQL0214N RC=2 MAYBE RECIEVED IF USING EXPRESSION IN THE ORDER BY CLAUSE.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Using expressions such as TO_CHAR, VARCHAR_FORMAT, DATE, TIME,
    TIMESTAMP, TIMESTAMP_FORMAT, TO_DATE, in the order by
    clause even though they are part of the select list.
    .
    For example:
    .
    db2 "create table test1(id int, mytime timestamp)"
    .
    db2 "insert into test1 values(1, '0001-01-01-00.00.00.000000')"
    db2 "insert into test1 values(2, '0002-02-02-00.00.00.000000')"
    db2 "insert into test1 values(3, '0001-01-01-00.00.00.000000')"
    db2 "insert into test1 values(4, '0004-04-04-00.00.00.000000')"
    db2 "insert into test1 values(5, '0002-02-02-00.00.00.000000')"
    .
    db2 "select distinct id, TO_CHAR(mytime, 'YYYY-MM-DD
    HH24:MI:SS') from test1 order by TO_CHAR(mytime,'YYYY-MM-DD
    HH24:MI:SS')"
    .
    This would fail with sql0214n rc=2
    

Local fix

Problem summary

  • Using expressions such as TO_CHAR, VARCHAR_FORMAT, DATE, TIME,
    TIMESTAMP, TIMESTAMP_FORMAT, TO_DATE, in the order by
    clause even though they are part of the select list.
    .
    For example:
    db2 "create table test1(id int, mytime timestamp)"
    .
    db2 "insert into test1 values(1, '0001-01-01-00.00.00.000000')"
    db2 "insert into test1 values(2, '0002-02-02-00.00.00.000000')"
    db2 "insert into test1 values(3, '0001-01-01-00.00.00.000000')"
    db2 "insert into test1 values(4, '0004-04-04-00.00.00.000000')"
    db2 "insert into test1 values(5, '0002-02-02-00.00.00.000000')"
    .
    db2 "select distinct id, TO_CHAR(mytime, 'YYYY-MM-DD
    HH24:MI:SS') from test1 order by TO_CHAR(mytime,'YYYY-MM-DD
    HH24:MI:SS')"
    .
    This would fail with sql0214n rc=2
    

Problem conclusion

  • apar ic75127
    module engn_sqnq
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC75127

  • 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-03-18

  • Closed date

    2011-12-08

  • Last modified date

    2012-01-25

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

    IZ96963

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

Modules/Macros

  • ENG_SQNQ
    

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:
25 January 2012