Page 1 of 1

EnableNumbers doesn't work with FLOAT

Posted: Thu 26 Mar 2020 18:59
by jdorlon
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

Re: EnableNumbers doesn't work with FLOAT

Posted: Fri 03 Apr 2020 15:10
by MaximG
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.

Re: EnableNumbers doesn't work with FLOAT

Posted: Fri 03 Apr 2020 15:23
by jdorlon
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

Re: EnableNumbers doesn't work with FLOAT

Posted: Mon 06 Apr 2020 16:58
by MaximG
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.