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.
TFloatField and number issue
Re: TFloatField and number issue
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
Re: TFloatField and number issue
Hello!
We have the same problem with TFloatField in TOraQuery.
Simple example:
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
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;
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
Re: TFloatField and number issue
Thank you for the information. We have reproduced the issue and will investigate its origin. We will inform you about the results shortly.
Re: TFloatField and number issue
We've reproduced the issue and fixed it. The fix will be included in the next build of our product. As a workaround, we can send you a night ODAC build including the required changes. For this provide us with your license number and IDE version you are interested in For your convenience, please use the e-support form https://www.devart.com/company/contactform.html