DB2 - Problem description
Problem IC75127 | Status: Closed |
SQL0214N RC=2 MAYBE RECIEVED IF USING EXPRESSION IN THE ORDER BY CLAUSE. | |
product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problem 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 | |
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 | |
Local Fix: | |
available fix packs: | |
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows | |
Solution | |
apar ic75127 module engn_sqnq | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 18.03.2011 08.12.2011 25.01.2012 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.7.0.5 |