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 IC92697 Status: Closed

DB2 MIGHT PRODUCE INCORRECT RESULT WHEN EXECUTING A QUERY WITH DATETIME
PREDICATES

product:
DB2 FOR LUW / DB2FORLUW / A10 - DB2
Problem description:
DB2 might produce incorrect result when executing a query with 
datetime predicates. 
The incorrect result will only happen if the table has a 
timestamp of the form 'YYYY-DD-MM:HH:MM:SS:24.00.00.000000' 
 
 
db2 "create table tablexyz (ts TIMESTAMP DEFAULT 
'2999-12-31-24.00.00.000000')" 
 
db2 "insert into tablexyz values ('2999-12-31-24.00.00.000000')" 
 
 
db2 "select * from tablexyz" 
 
TS 
-------------------------- 
2999-12-31-24.00.00.000000 
 
  1 record(s) selected. 
 
Example 1: 
db2 "select * from tablexyz where date(ts) = '2999-12-31'" 
 
ts 
-------------------------- 
 
  0 record(s) selected. 
 
Example 2: 
db2 "select * from tablexyz where year(ts) = 2999" 
 
TS 
-------------------------- 
 
  0 record(s) selected. 
 
Example 3: 
db2 "select * from tablexyz where year(ts) = 2999 and month(ts) 
= 12" 
 
TS 
-------------------------- 
 
  0 record(s) selected.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* ALL                                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 Version 10.1 and Fix Pack 3                   * 
****************************************************************
Local Fix:
Workaround: Manually rewrite the predicate from date/year to 
timestamp format. 
Example1. 
select * from tablexyz where ts >= 
'2999-12-31-00.00.00.000000' and ts <= 
'2999-12-31-24.00.00.000000' 
 
example 2. 
select * from tablexyz where ts >= 
'2999-01-01-00.00.00.000000' and ts <= 
'2999-12-31-24.00.00.000000' 
 
select * from tablexyz where ts >= 
'2999-12-01-00.00.00.000000' and ts <= 
'2999-12-31-24.00.00.000000'
available fix packs:
DB2 Version 10.1 Fix Pack 3 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 3a for Linux, UNIX, and Windows
DB2 Version 10.1 Fix Pack 6 for Linux, UNIX, and Windows

Solution
Problem was first fixed in DB2 Version 10.1 and Fix Pack 3
Workaround
not known / see Local fix
BUG-Tracking
forerunner  : APAR is sysrouted TO one or more of the following: IC95380 
follow-up : 
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
31.05.2013
27.09.2013
27.09.2013
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
10.1.0.3 FixList
10.1.0.3 FixList