home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

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
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 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 FixList