
Migrating to Sybase Adaptive Server Enterprise 11.5 5-7
Adaptive Server Enterprise 11.5 If Your Current Version is 4.x
scale, the results are truncated without warning. For example,
explicitly converting a float to an integer causes SQL Server to
truncate all values to the right of the decimal point.
The rationale is that explicit conversions are done purposefully
with an understanding of the implications and consequences.
• Integer to character conversion: Conversions from integer to
character return an error if an overflow occurs. They formerly
returned a buffer of “***”.
ANSI SQL92 Support for Conversion Error Handling
Conversion error handling is now ANSI SQL92 compliant. These
changes allow an application to decide the severity of error. They
may result in different error handling behavior than in release 4.x.
Here is a summary of these changes:
arithabort arith_overflow
The command:
set arithabort arith_overflow
specifies behavior following a divide-by-zero error or a loss of
precision during either an explicit or an implicit datatype
conversion. (In 4.x, divide-by-zero returned NULL.) Options are:
ON (default): Rolls back the entire transaction or batch in which the
error occurs.
OFF (ANSI SQL92 Standard): Aborts the statement that causes the
error and continues to process other statements in the transaction or
batch.
Application recoding is required to use ANSI semantics.
arithabort numeric_truncation
The command:
set arithabort numeric_truncation
specifies behavior following a loss of scale by an exact numeric type.
Options are:
ON (Default and ANSI SQL92 Standard): Aborts the statement that
caused the error continues to process other statements in the
transaction or batch.
OFF: truncates value and continues processing.
Komentáře k této Příručce