The arithabort and arithignore set options allow compliance with the ANSI SQL standard as follows:
arithabort arith_overflow specifies behavior following a divide-by-zero error or a loss of precision. The default setting, arithabort arith_overflow on, rolls back the entire transaction in which the error occurs. If the error occurs in a batch that does not contain a transaction, arithabort arith_overflow on does not roll back earlier commands in the batch, but Adaptive Server does not execute statements in the batch that follow the error-generating statement.
If you set arithabort arith_overflow off, Adaptive Server aborts the statement that causes the error but continues to process other statements in the transaction or batch.
arithabort numeric_truncation specifies behavior following a loss of scale by an exact numeric type. The default setting, on, aborts the statement that causes the error but continues to process other statements in the transaction or batch. If you set arithabort numeric_truncation off, Adaptive Server truncates the query results and continues processing. For compliance with the ANSI SQL standard, enter set arithabort numeric_truncation on.
arithignore arith_overflow determines whether Adaptive Server displays a message after a divide-by-zero error or a loss of precision. The default setting, off, displays a warning message after these errors. Setting arithignore arith_overflow on suppresses warning messages after these errors. For compliance to the ANSI SQL standard, enter set arithignore off.
See the jConnect Programmers Reference Guide for information on handling warnings in JDBC code. This information is in the chapter “Programming Information,” in the section “Handling error messages.” Look for the topic “Handling numeric overflows that are returned as warnings from ASE.”