IDatabase.SupportDecimal

Fore Syntax

SupportDecimal: Boolean;

Fore.NET Syntax

SupportDecimal: Boolean;

Description

The SupportDecimal property determines whether it is possible to work with real fields as with decimal data type fields.

Comments

By default the property is set to False, the fields on the repository level, that have float data type are considered as fields with the DbDataType.Float type. When working, values of such fields are rounded to 13 digits after the comma. If the SupportDecimal property is set to True, real fields on the repository level are considered as fields with the DbDataType.Decimal decimal type. In this case values are rounded to 27 digits after the comma.

After decimal type support is enabled, refresh information about tables so that decimal type is set for real type fields in their structure in the repository. The information is refreshed if common length and general accuracy of fields allow for it.

On the DBMS level the type of data of physical fields remains unchanged in both cases.

NOTE. Data sources that use decimal data type and created in older versions of platform may not be supported in later versions. It may require to recreate data source.

Fore Example

Executing the example requires that the repository contains a database with the DB identifier.

Sub UserProc;
Var
    MB: IMetabase;
    Db: IDatabase;
Begin
    MB := MetabaseClass.Active;
    Db := MB.ItemById("DB").Edit As IDatabase;
    Db.SupportDecimal := True;
    (Db As IMetabaseObject).Save;
End Sub UserProc;

On executing the example decimal data type support is enabled for the specified database.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Db;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Db: IDatabase;
Begin
    MB := Params.Metabase;
    Db := MB.ItemById["DB"].Edit() As IDatabase;
    Db.SupportDecimal := True;
    (Db As IMetabaseObject).Save();
End Sub;

See also:

IDatabase