Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Database/Data Access Controls    [ Add a report in this area ]  
Report #:  132353   Status: Open
TField.AsExtended write miss.
Project:  Delphi Build #:  20.0.16277.1276
Version:    20.1 Submitted By:   Eden WU
Report Type:  Basic functionality failure Date Reported:  7/3/2015 7:13:12 AM
Severity:    Serious / Highly visible problem Last Updated: 7/6/2015 6:02:55 AM
Platform:    All platforms Internal Tracking #:   64803
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 5
Description
TField type is TFmtBCDField.
When write extended value in the field.
In fact, it is write currency value.
Steps to Reproduce:
{ SQL Server 2008 R2
CREATE TABLE TA(Exdd NUMERIC(18,6) PRIMARY KEY);
}

var exd: Extended;
begin
  exd := 3.14159;
  SimpleDataSet1.Append;
  SimpleDataSet1.Fields[0].AsExtended := exd;
  SimpleDataSet1.Post;
  SimpleDataSet1.ApplyUpdate(0);
end;

Write value is "3.1416" in database.
Workarounds
AsExtended change to "AsVariant", "Value", "AsBCD" or "AsString".

Write correctly!
Attachment
None
Comments

None

Server Response from: ETNACODE01