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

"DB2 -A" RETURNS UNEXPECTED SQLSTATE WHEN AN ADJUSTMENT WAS MADE
TO THE INVALID DATE CALCULATED USING DATE() WITH LITERAL VALUE.

product:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
Problem description:
If we force to calculate an impossible date like 02/30/2012, it 
will be adjusted to 02/29/2012 and the warning with SQLSTATE 
01506 should be returned. (Note that 2012 is a leap year.) 
 
SQLSTATE 01506: An adjustment was made to a DATE or TIMESTAMP 
value to correct an invalid date resulting from an arithmetic 
operation. 
 
For example: 
$ db2 conect to sample 
 
$ date 
Fri Aug 17 05:11:20 EDT 2012 
 
$ db2 -a "values date('08/17/2012') + 13 day - 6 month" 
 
1 
---------- 
02/29/2012 
 
  1 record(s) selected. 
 
 
SQLCA Information 
 
 sqlcaid : SQLCA     sqlcabc: 136   sqlcode: 0   sqlerrml: 0 
 sqlerrmc: 
 sqlerrp : SQLRI01F 
 sqlerrd : (1) -2147221503      (2) 1                (3) 0 
           (4) 0                (5) 0                (6) 0 
 sqlwarn : (1)      (2)      (3)      (4)        (5)       (6) 
           (7)      (8)      (9)      (10)       (11) 
 sqlstate: 00000 --> This should be 01506. 
 
However, if we use "current date", the warning is returned 
properly. 
 
$ db2 -a "values date(current date) + 13 day - 6 month" 
 
1 
---------- 
02/29/2012 
 
  1 record(s) selected. 
 
 
SQLCA Information 
 
 sqlcaid : SQLCA     sqlcabc: 136   sqlcode: 0   sqlerrml: 0 
 sqlerrmc: 
 sqlerrp : SQL09074 
 sqlerrd : (1) 0                (2) 0                (3) 0 
           (4) 0                (5) 0                (6) 0 
 sqlwarn : (1) W    (2)      (3)      (4)        (5)       (6) 
           (7) W    (8)      (9)      (10)       (11) 
 sqlstate: 01506
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* All                                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to Version 9.7 FixPack 8                             * 
****************************************************************
Local Fix:
Not available
available fix packs:
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
Problem was first fixed in DB2 UDB Version 9.7 FixPack 8
Workaround
not known / see Local fix
BUG-Tracking
forerunner  : APAR is sysrouted TO one or more of the following: IC86013 
follow-up : 
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
17.08.2012
09.04.2013
09.04.2013
Problem solved at the following versions (IBM BugInfos)
9.7.FP8
Problem solved according to the fixlist(s) of the following version(s)
9.7.0.8 FixList