DB2 - Problem description
Problem IC97491 | 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 / A10 - 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 version 10.1 fix pack 4 * **************************************************************** | |
Local Fix: | |
Explicitly set the parameter marker to data type TIMESTAMP instead of DATE | |
available fix packs: | |
DB2 Version 10.1 Fix Pack 4 for Linux, UNIX, and Windows | |
Solution | |
First fixed in DB2 version 10.1 fix pack 4 | |
Workaround | |
not known / see Local fix | |
BUG-Tracking | |
forerunner : APAR is sysrouted TO one or more of the following: IC98756 follow-up : | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 07.11.2013 07.07.2014 07.07.2014 |
Problem solved at the following versions (IBM BugInfos) | |
Problem solved according to the fixlist(s) of the following version(s) | |
10.1.0.4 |