The Problem with TLargeIntField using InterBaseprovider

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wix
Posts: 5
Joined: Sat 05 Oct 2013 05:17

The Problem with TLargeIntField using InterBaseprovider

Post by wix » Wed 13 Aug 2014 14:21

Hello. I'm trying to store Int64 value 481767703092024977 in the field type NUMERIC(18,0). Eventually the field value in DB equals 481767703092024960. I set the data type mapping in the TUniConnection component like that

Code: Select all

    DataTypeMap = <
      item
        DBType = 408
        DBLengthMin = 18
        DBLengthMax = 18
        DBScaleMin = 0
        DBScaleMax = 0
        FieldType = ftLargeint
      end>

PavloP
Devart Team
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: The Problem with TLargeIntField using InterBaseprovider

Post by PavloP » Fri 15 Aug 2014 12:35

For the NUMERIC(18,0) table column, the TFloatField filed is created by default, precision of which is not enough for storing the value, that you want to insert.
To solve the issue, set value for the SimpleNumericMap parameter of the TUniConnection.SpecificOptions property in False:

Code: Select all

UniConnection1.SpecificOptions.Values['SimpleNumericMap'] := 'False';
In this case TLargeIntField will be created. It will be able to store the required value. The usage of DataTypeMapping in this case is not required.

Post Reply