On 2021-07-07 17:25, Ismael L. Donis Garcia wrote:
> I have an application developed in lasarus with Firebird 2.5.9 which
> works perfect.
> And I've been trying to migrate it to Firebird 4, but I'm having
> trouble getting the data.
> For example:
> When I ask the following question it always returns 0.
> if (dm.rssc3.FieldByName ('balance'). AsFloat <> 0) then netreg ();
> even though the record is not 0.
> If I use:
> DataTypeCompatibility = 3.0
> The system does work correctly, but I don't want to modify the
> firebird configuration so that the system works correctly.
> What other action can I do to get it to return the correct value?
>
> Will this problem have to do with a DLL version?
This probably has to do with whatever data type balance is and how it's
produced (i.e. what the underlying query is).
I'm going to guess it is a SUM of some NUMERIC or DECIMAL column, so the
resulting type is a NUMERIC/DECIMAL with precision 38 (introduced in
Firebird 4). Probably whatever library you're using doesn't support the
INT128-backed NUMERIC/DECIMAL types with precision between 19 and 38.
Mark