In this post, you’ll learn about the error message +802 exception error exception-type has occurred during operation-type operation on data-type data, position position-number in the IBM DB2 database , the reason why it occurs along with the solution to fix it
IBM DB2 Error Message
+802 exception error exception-type has occurred during operation-type operation on data-type data, position position-number
Reason for the Error
The exception error ‘exception-type’ occurred while doing an ADDITION, SUBTRACTION, MULTIPLICATION, DIVISION, or NEGATION operation on a field whose ‘data-type’ is DECIMAL, FLOAT, SMALLINT, or INTEGER.� The error occurred while processing an arithmetic expression in the SELECT list of an outer SELECT statement, and the position in the select list is denoted by ‘position-number’.� The possible exception types are FIXED POINT OVERFLOW, DECIMAL OVERFLOW, DIVIDE EXCEPTION, EXPONENT OVERFLOW, and ZERO DIVIDE.� The data type displayed in the message may indicate the data type of the temporary internal copy of the data, which may differ from the actual column or literal data type due to conversions by DB2.A fixed point overflow can occur during any arithmetic operation on either INTEGER or SMALLINT fields.A decimal overflow exception can occur when one or more non-zero digits are lost because the destination field in any decimal operation is too short to contain the result.
Solution
Examine the expression for which the warning occurred to see if the cause (or the likely cause) of the problem can be determined.� The problem may be data-dependent, in which case it will be necessary to examine the data that was being processed at the time the error occurred. Check arithmetic operation for divide by zero or result to exceed size of host variable.