EnableNumbers doesn't work with FLOAT

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

EnableNumbers doesn't work with FLOAT

Post by jdorlon » Thu 26 Mar 2020 18:59

Hello,

In the latest ODAC version, on Delphi 10.1, the FLOAT datatype does not use the EnableNumbers option in TOraSession. DataType is ftFloat instead of ftNumber.

This worked in version 10..x

You can use this script to see the problem:

Code: Select all

create table a_float (col1 float(126));

insert into a_float (col1) values (0.000000000000000000001);
insert into a_float (col1) values (0.00000000000000000001);
insert into a_float (col1) values (0.0000000000000000001);
insert into a_float (col1) values (0.000000000000000001);
insert into a_float (col1) values (0.00000000000000001);
insert into a_float (col1) values (0.0000000000000001);
insert into a_float (col1) values (0.000000000000001);
insert into a_float (col1) values (0.00000000000001);
insert into a_float (col1) values (0.0000000000001);
insert into a_float (col1) values (0.000000000001);
insert into a_float (col1) values (0.00000000001);
insert into a_float (col1) values (0.0000000001);
insert into a_float (col1) values (0.000000001);
insert into a_float (col1) values (0.00000001);
insert into a_float (col1) values (0.0000001);
insert into a_float (col1) values (0.000001);
insert into a_float (col1) values (0.00001);
insert into a_float (col1) values (0.0001);
insert into a_float (col1) values (0.001);
insert into a_float (col1) values (0.01);
insert into a_float (col1) values (0.1);
insert into a_float (col1) values (1);
insert into a_float (col1) values (10);
insert into a_float (col1) values (100);
insert into a_float (col1) values (1000);
insert into a_float (col1) values (10000);
insert into a_float (col1) values (100000);
insert into a_float (col1) values (1000000);
insert into a_float (col1) values (10000000);
insert into a_float (col1) values (100000000);
insert into a_float (col1) values (1000000000);
insert into a_float (col1) values (10000000000);
insert into a_float (col1) values (100000000000);
insert into a_float (col1) values (1000000000000);
insert into a_float (col1) values (10000000000000);
insert into a_float (col1) values (100000000000000);
insert into a_float (col1) values (1000000000000000);
insert into a_float (col1) values (10000000000000000);
insert into a_float (col1) values (100000000000000000);
insert into a_float (col1) values (1000000000000000000);
insert into a_float (col1) values (10000000000000000000);
insert into a_float (col1) values (100000000000000000000);
insert into a_float (col1) values (1000000000000000000000);
commit;

select * from a_float;
My ODAC subscription includes source. Please let me know if there is a small change that I can make to correct this.

Thank you.

John Dorlon

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: EnableNumbers doesn't work with FLOAT

Post by MaximG » Fri 03 Apr 2020 15:10

The previous versions of ODAC had an error: FLOAT(126) fields were mapped to TOraNumberField when the user enabled the EnableNumbers option. Regardless of the value of the EnableNumbers option, such fields should be mapped to TFloatField. The right method to representing a field as a field of the needed data type, is by using DataTypeMapping. Currently we're investigating the possibility of adding such functionality; we'll let you know the result once we finish the investigation.

jdorlon
Posts: 202
Joined: Fri 05 Jan 2007 22:07

Re: EnableNumbers doesn't work with FLOAT

Post by jdorlon » Fri 03 Apr 2020 15:23

Hi Maxim,

I don't understand, why was it wrong to map FLOAT(126) to TOraNumber (when EnableNumbers is set)?

TOraNumber still shows decimal places, just not scientific notation.

Am I missing something?

Thanks

John Dorlon

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: EnableNumbers doesn't work with FLOAT

Post by MaximG » Mon 06 Apr 2020 16:58

The EnableNumbers property is designed to represent NUMBER data type fields, whereas in your example, you're using the FLOAT data type. Thus, using DataTypeMapping is the correct way to proceed.
We'll notify you about the availability of the DataTypeMapping feature once we implement it.

Post Reply