Page 1 of 1

The Problem with TLargeIntField using InterBaseprovider

Posted: Wed 13 Aug 2014 14:21
by wix
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>

Re: The Problem with TLargeIntField using InterBaseprovider

Posted: Fri 15 Aug 2014 12:35
by PavloP
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.