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

DATE PARAMETER MARKER IS NOT CONVERTED TO TIMESTAMP(0) IN A DATE AS
TIMESTAMP(0) ENABLED DATABASE WITH DEFERRED PREPARE ENABLED

product:
DB2 FOR LUW / DB2FORLUW / A50 - DB2
Problem description:
In a DATE as TIMESTAMP(0) enabled database, the data type DATE 
should always be treated as TIMESTAMP(0).  However, when 
DB2_DEFERRED_PREPARE_SEMANTICS is enabled, a parameter marker 
that is set to the DATE data type will not be converted to 
TIMESTAMP(0).  This may not cause any problem at all, or there 
may be various symptoms depending on how the parameter marker is 
used. 
 
This example would not have any problem since the query only 
looks at the year: 
 
  select * from T where year(?) = year( current date ) 
 
The following query fails with SQLCODE -401: 
 
  select * from T where DATECOL < ? + 1 
 
The following query may return a wrong result because HOUR(?) 
always returns 0: 
 
  select * from T where hour(?) = hour( current date ) 
 
In the next example, the returned value will be a simple DATE 
(year, month and day) instead of the expected TIMESTAMP(0): 
 
  select ? from T
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* ALL                                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 Cancun Release 10.5.0.4                       * 
****************************************************************
Local Fix:
Explicitly set the parameter marker to data type TIMESTAMP 
instead of DATE
available fix packs:
DB2 Cancun Release 10.5.0.4 (also known as Fix Pack 4) for Linux, UNIX, and Windows
DB2 Version 10.5 Fix Pack 9 for Linux, UNIX, and Windows

Solution
First fixed in DB2 Cancun Release 10.5.0.4
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
15.01.2014
15.09.2014
15.09.2014
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
10.5.0.4 FixList