Hi,
We use FIBPlus in our application and we are changing to ZEOS framework. In the FIB exists a property in the dataset (PrepareOptions) called psSQLINT64toBCD, when i check this the BIGINT in the Firebird is treated like type BCD size 0. Is there something like this in the ZEOS?
In the moment i am receiving this message of error when i execute:
ERRO(#01): cdsCfg: Type mismatch for field 'ID', expecting: FMTBcdField actual: LargeInt
In the file Zeos.inc i comment:
{$DEFINE WITH_ASLARGEINT}
{$DEFINE WITH_PARAM_ASLARGEINT}
{$DEFINE TFIELD_HAS_ASLARGEINT}
But the error continues.
LargeInt like FMTBcdField Size 0
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: LargeInt like FMTBcdField Size 0
Hello amonteiro,
No - there is no property like that in Zeos. Why would you want to treat an INT64 field as a BCD?
This error means that your persistent field is a TFMTBcdField and Zeos expects you to have a TLargeIntField. You should change your field definition in the dfm file and the pas file.
These defines are not meant to be modified by Zeos users. They tell zeos which capabilities the RTL has that is in use.
Re: LargeInt like FMTBcdField Size 0
Hi,
I changed to LargeInt the INT64 field and it works.
With BCD field i have this situation now:
object cdsClienteLIMITE: TBCDField
FieldName = 'LIMITE'
Origin = 'GETCLIENTE.LIMITE'
Precision = 32
Size = 2
end
The field above is giving the error "expecting BCD actual: FMTBCDField". I changed the property "ControlsCodePage := cGET_ACP" but the error already keep. Is there a mode to treat this field like a TBCDField?
Note: In my tests, if size different 4(NUMERIC 18,2) i receive the error above, but if i keep it in 4(NUMERIC 18,4) don't give me the error.
I changed to LargeInt the INT64 field and it works.
With BCD field i have this situation now:
object cdsClienteLIMITE: TBCDField
FieldName = 'LIMITE'
Origin = 'GETCLIENTE.LIMITE'
Precision = 32
Size = 2
end
The field above is giving the error "expecting BCD actual: FMTBCDField". I changed the property "ControlsCodePage := cGET_ACP" but the error already keep. Is there a mode to treat this field like a TBCDField?
Note: In my tests, if size different 4(NUMERIC 18,2) i receive the error above, but if i keep it in 4(NUMERIC 18,4) don't give me the error.
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: LargeInt like FMTBcdField Size 0
Hello amonteiro,
Delphi and FPC have to different types to support BCD like fields: TBCDField and TFMTBCDField. Depending on your field sizes, Zeos will choose one of those field types.
TBCDField uses the Currency type internally which really just is an Integer. TFMTBCDField uses the TBCD data type which is slower in use than the Currency type but allows to store bigger numbers. So - again you will have to change your field type from TBCDField to TFMTBCDField.
Your numeric(18,2) can store numbers that are just to big for the Currency data type. This is why Zeos chooses TFMTBCDField for that column.
Best regards,
Jan
Delphi and FPC have to different types to support BCD like fields: TBCDField and TFMTBCDField. Depending on your field sizes, Zeos will choose one of those field types.
TBCDField uses the Currency type internally which really just is an Integer. TFMTBCDField uses the TBCD data type which is slower in use than the Currency type but allows to store bigger numbers. So - again you will have to change your field type from TBCDField to TFMTBCDField.
Your numeric(18,2) can store numbers that are just to big for the Currency data type. This is why Zeos chooses TFMTBCDField for that column.
Best regards,
Jan