Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.0 » SQL Anywhere Server - Database Administration » Configuring Your Database » Database options » Introduction to database options » Alphabetical list of options

 

precision option [database]

Specifies the maximum number of digits in the result of any decimal arithmetic.

Allowed values

Integer, between 1 and 127, inclusive

Default

30

Scope

Can be set for the PUBLIC group only. Takes effect immediately.

Remarks

Precision is the total number of digits to the left and right of the decimal point. The scale option specifies the minimum number of digits after the decimal point when an arithmetic result is truncated to the maximum precision.

Multiplication, division, addition, subtraction, and aggregate functions can all have results that exceed the maximum precision.

For example, when a DECIMAL(8,2) is multiplied with a DECIMAL(9,2), the result could require a DECIMAL(17,4). If precision is 15, only 15 digits will be kept in the result. If scale is 4, the result will be a DECIMAL(15,4). If scale is 2, the result will be a DECIMAL(15,2). In both cases, there is a possibility of overflow.