Wring data to SQL SERVER decimal data type incorrect

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
a29237876
Posts: 1
Joined: Tue 10 Sep 2019 12:17

Wring data to SQL SERVER decimal data type incorrect

Post by a29237876 » Tue 10 Sep 2019 12:32

A data field in SQL SERVER declare as decimal(9,2)
use UniLoader write data to SQL SERVER

when some data value, which is 0.05 store on some delphi variable which is declare as double data type, the data write to SQL SERVER become some 0.04 and some 0,05, the 0.04 is incorrect
If I use const value 0.05 in uniLoader, No problem, data write to SQL Server is always 0.05
If I change SQL SERVER data field as decimal(9,3), then some value is 0.049

if change data type to smallmoney, then no problem.

is this bug?

SQL SERVER 2017, Delphi 2007, UniDac 8

FCS
Posts: 176
Joined: Sat 23 Feb 2013 18:46

Re: Wring data to SQL SERVER decimal data type incorrect

Post by FCS » Tue 10 Sep 2019 16:55

Hello,

It could be releated to the Delphi Round function.

Regards
Michal

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: Wring data to SQL SERVER decimal data type incorrect

Post by Stellar » Thu 12 Sep 2019 11:04

Unfortunately, we can't reproduce the issue. To investigate this behavior of UniDAC, please compose a small sample demonstrating the issue and send it to us, including database objects creating scripts.
You can send the sample using the contact form at our site: devart.com/company/contactform.html

Post Reply