Aviso importante
Caso tenhas alguma
dúvida a respeito
da linguagem mande
um e-mail que terás
a resposta.
C. A. Dornelles
SQL - SQLCODE's - Códigos positivos
Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF.
SQLCode +802
EXCEPTION ERROR
exception-type
HAS OCCURRED DURING
operation-type
OPERATION ON
data-type
DATA, POSITION
position-number
Causa
The exception error
exception-type
occurred while doing an ADDITION, SUBTRACTION, MULTIPLICATION, DIVISION, NEGATION, or BUILT-IN FUNCTION 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, ZERO DIVIDE, or OUT OF RANGE. 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 nonzero digits are lost because the destination field in any decimal operation is too short to contain the result.
A divide exception can occur on a decimal division operation when the quotient exceeds the specified data-field size. A zero divide exception occurs on any division by zero.
An exponent overflow can occur when the result characteristic of any floating-point operation exceeds 127 and the result fraction is not zero, i.e. the magnitude of the result exceeds approximately 7.2E+75.
Any of the exceptions/overflows can occur during the processing of a built-in function. If the
operation-type
is FUNCTION then the error occurred while processing either an input, intermediate, or final value. The cause could be that the value of a parameter is
out
of
range
.
Note: Parts of
exception-type
,
data-type
,
operation-type
, and
position-number
may or may not be returned in SQLCA, depending upon when the error was detected.
Ação do sistema
For each expression in error the indicator variable is set to negative two (-2) to indicate a null value returned. The data variable is unchanged. Execution of the statement continues with all nonerror columns and expressions of the outer SELECT list being returned. If the statement is cursor controlled then the CURSOR will remain open.
Resposta ao Desenvolvedor
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.
See the explanation of SQLCODE -405 for allowed ranges of numeric data types.
SQLSTATE: 01519