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

SQL Anywhere 10.0.1 » UltraLite - Database Management and Reference » UltraLite Database Settings Reference » Configurable properties in UltraLite

UltraLite precision property Next Page

UltraLite scale property


Specifies the minimum number of digits after the decimal point when an arithmetic result is truncated to the maximum precision.

How to set it

UltraLite employs different methods for setting this property:

ContextImplemented by

From the command line    Use any utility that creates a database.

Use the following property syntax:

- o scale=value

From Sybase Central    Use any wizard that creates a database.

On the New Database Options page, set the Scale option.

From a client application    Use the create database method.

Set this property as one of the creation parameters for an API's create database method on the database manager class.

Allowed values

Integer, between 0 and 127, inclusive, and less than the value specified for the precision database option

Default

6

Remarks

You cannot change the scale of an existing database. Instead, you must create a new database.

The scale property specifies the minimum number of digits after the decimal point. Multiplication, division, addition, subtraction, and aggregate functions can all have results that exceed the maximum scale.

Use this property with the precision property, which is also used to determine the entire length of arithmetic results.

See also
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 are kept in the result. If scale is 4, the result is DECIMAL(15,4). If scale is 2, the result is a DECIMAL(15,2). In both cases, there is a possibility of overflow.