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

AVOID TO DIVISION BY ZERO SQL0801N

product:
DB2 FOR LUW / DB2FORLUW / A50 - DB2
Problem description:
The following example show the scenario: 
 
create table t1 ( c1 char(2) , c2 int , c3 int ) 
DB20000I  The SQL command completed successfully. 
 
insert into t1 values('a',20,5) 
DB20000I  The SQL command completed successfully. 
 
insert into t1 values('b',20,18) 
DB20000I  The SQL command completed successfully. 
 
insert into t1 values('c',20,10) 
DB20000I  The SQL command completed successfully. 
 
insert into t1 values('d',20,0) 
DB20000I  The SQL command completed successfully. 
 
select c1,c2,c3,(c2/c3) as ratio from t1 where c3 > 0 and 
(c2/c3) > 3 
   c1         c2          c3       RATIO 
---- ----------- ----------- ----------- 
a             20           5           4 
SQL0801N  Division by zero was attempted.  SQLSTATE=22012
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* All DB2 V10.5 users                                          * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* See Error Description                                        * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 V10.5 Fix Pack 5 or higher.                   * 
****************************************************************
Local Fix:
NA
Solution
Fixed in DB2 V10.5 Fix Pack 5
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
12.09.2014
29.04.2015
29.04.2015
Problem solved at the following versions (IBM BugInfos)
Problem solved according to the fixlist(s) of the following version(s)
10.5.0.5 FixList