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

INCORRECT TRUTH VALUE FROM COMPARISON OF TIMESTAMP TO STRING HAVING HIGHER
PRECISION THAN THE TIMESTAMP

product:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
Problem description:
In V9.7 the precision of the timestamp operand in a comparison 
could be less than the number of fractional seconds in the 
string representation of a timestamp. Currently, the comparison 
uses the same precision as the timestamp operand, thus 
truncating even non-zero fractional seconds digits when 
converting the string representation to a timestamp. 
 
For example, the equality predicate TIMESTAMP 
'2010-08-18-15.20.25' = '2010-08-18-15.20.25.123' is TRUE 
because the left operand has a type of TIMESTAMP(0) and then 
converts the right operand to the same, losing the 3 fractional 
seconds digits before doing the comparison. The expected result 
in this case would be FALSE. 
 
Example of above current using a column: 
create table t1 (c1 timestamp(0)); 
insert into t1 values ('2010-08-18-15.20.25'); 
select c1 from t1 where c1 = '2010-08-18-15.20.25.123'; 
C1 
------------------- 
2010-08-18-15.20.25 
 
Comparisons that involve timestamp values are evaluated 
according to the following rules: 
 - When comparing timestamp values with different precisions, 
the higher precision is used for the comparison and any missing 
digits for fractional seconds are assumed to be zero. 
 - When comparing a timestamp value with a string representation 
of a timestamp, the string representation is first converted to 
TIMESTAMP(12). 
 - Timestamp comparisons are chronological without regard to 
representations that might be considered equivalent. Thus, the 
following predicate is true: 
TIMESTAMP('1990-02-23-00.00.00') > '1990-02-22-24.00.00'
Problem Summary:
Local Fix:
Explicitly cast string into a TIMESTAMP(p)
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
Workaround
not known / see Local fix
Comment
This is a new requirement
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
06.07.2011
19.01.2012
19.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