-20365   A SIGNALING NAN WAS ENCOUNTERED, OR AN EXCEPTION OCCURRED IN AN ARITHMETIC OPERATION OR FUNCTION INVOLVING A DECFLOAT

Explanation

A signaling NaN (sNaN) was encountered in an expression, arithmetic operation, or function. This message could also be issued because an expression, arithmetic operation, or function involving a DECFLOAT column or value resulted in an exception. In either case, the result is a NAN, and an error is issued.

System action

The statement cannot be processed. In the case of an INSERT, MERGE, or UPDATE operation, no data is updated or deleted. If the statement is a cursor-controlled FETCH, then the cursor will remain open, unless the exception occurred while processing an aggregate function. If the exception occurred while processing an aggregate function, it is indicated by an operation-type of AGGREGATE FUNCTION. If this is the case, the cursor will be closed. If the cursor is closed, subsequent attempts to use that cursor without first doing an OPEN for it, receive an SQLCODE-501. If the statement was a cursor-controlled OPEN, then the cursor will remain closed.

User response

Examine the expression which prompted the warning to see if the cause of the problem can be determined. The problem might be data-dependent, in which case you must examine the data that was being processed at the time the error occurred.

If the arithmetic expression in error was within the SELECT list of the outer SELECT statement, then you should include an indicator variable for all expressions in the SELECT list. This allows processing to continue so that non-error column and expression values can be returned.

See the explanation of SQLCODE -405 for allowed ranges of numeric data types.

SQLSTATE:

22502