Migrating dbExpress project to ODAC without TFloatField

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
marilyn.works
Posts: 4
Joined: Wed 02 Nov 2011 08:47

Migrating dbExpress project to ODAC without TFloatField

Post by marilyn.works » Wed 09 Nov 2011 08:10

I am migrating project that uses Oracle database, most of the fields in database are number, some functions return number. The problem is that when function returns number and is selected to application comes field with precision 32 and size 0, which is loosing decimals. The other problem is when fields are defined (15,2) it comes as TFloatField, but i dont want to change my old TFmtBcdField. My session setup to work with bcd, fmtbcd and integer.

regards
Last edited by marilyn.works on Wed 09 Nov 2011 10:10, edited 1 time in total.

marilyn.works
Posts: 4
Joined: Wed 02 Nov 2011 08:47

Post by marilyn.works » Wed 09 Nov 2011 09:04

The same problem with loosing precision is when in sql is used agregate function.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 10 Nov 2011 08:41

Hello,

To change the field type from ftFloat to ftFMTBcd you need to reduce the value of the global FloatPrecision variable that is defined in the OraClasses module. For example, to make the Number(15,2) field ftFMTBcd, you need to set the value of the variable to 14 - FloatPrecision:= 14;

I cannot reproduce the problem with losing precision when using functions and aggregates, that's why send your sample including scripts for creating database objects to alexp*devart*com.

Post Reply