TFloatField and number issue

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
simonemontigiani
Posts: 1
Joined: Thu 05 Sep 2019 09:45

TFloatField and number issue

Post by simonemontigiani » Thu 05 Sep 2019 10:09

Hi team,

we recently updated ODAC components from 10.3.9 to 11.0.1 in Delphi 10.3.2.

We encountered a problem updating the value of a NUMBER field through declared TFloatField in TOraQuery.

In a specific example, we execute a post using a DB aware component:
The value in the specific example is 81,21 but the value received by the database is 81,20999999999999.

The problem is that we have an ON BEFORE UPDATE trigger testing the equality of OLD and NEW values of the NUMBER field.
That decimal difference raises an error and blocks the UPDATE.

This problem was introduced in 10.4.10 or 11.0.1, the 10.3.9 doesn't have this issue.
We temporary downgraded to 10.3.9 waiting for the resolution.

Thank you!

Best regards,

Simone Montigiani
Generazione Informatica S.r.l.

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

Re: TFloatField and number issue

Post by MaximG » Fri 06 Sep 2019 10:39

Thank you for the information. Unfortunately, the provided description is not enough to reproduce the issue in our environment. Please compose and send a small project, executionn of which causes the issue. In addition, we need a information about the structure of tables (DDL-script) with which this application works. For your convenience, please use the e-support form https://www.devart.com/company/contactform.html

InsLabRU
Posts: 1
Joined: Wed 16 Oct 2019 06:35

Re: TFloatField and number issue

Post by InsLabRU » Wed 16 Oct 2019 06:57

Hello!

We have the same problem with TFloatField in TOraQuery.
Simple example:

Code: Select all

procedure TfmMain.Button3Click(Sender: TObject);
var
  tmpOraSession: TOraSession;
  tmpOraQuery: TOraQuery;
begin
  tmpOraSession := TOraSession.Create(nil);
  try
    tmpOraSession.Options.UseUnicode := True;
    tmpOraSession.Options.UnicodeEnvironment := True;
    tmpOraSession.Options.Direct := True;
    tmpOraSession.Server := 'OraTest:1521:OraTest';
    tmpOraSession.LoginPrompt := False;
    tmpOraSession.UserName := 'xxxxx';
    tmpOraSession.Password := 'xxxxx';
    tmpOraSession.Connected := True;

    tmpOraQuery := TOraQuery.Create(nil);
    try
      tmpOraQuery.Session := tmpOraSession;
      tmpOraQuery.SQL.Text := 'begin raise_application_error(-20001, ''value = '' || :x); end;';
      tmpOraQuery.ParamByName('x').AsFloat := 81.21;
      tmpOraQuery.ExecSQL;
    finally
      tmpOraQuery.Free;
    end;
  finally
    tmpOraSession.Free;
  end;
end;
Using Delphi 10.3.2
With ODAC 10.3.8 result = 81.21
With ODAC 10.3.9 result = 81.21
With ODAC 10.4.10 result = 81,20999999999999
With ODAC 11.0.1 result = 81,20999999999999

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

Re: TFloatField and number issue

Post by MaximG » Fri 18 Oct 2019 12:39

Thank you for the information. We have reproduced the issue and will investigate its origin. We will inform you about the results shortly.

Post Reply