SQL Server Map Decimal to BCD

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
fontenele
Posts: 1
Joined: Wed 07 Oct 2020 20:41

SQL Server Map Decimal to BCD

Post by fontenele » Wed 07 Oct 2020 21:03

I have a connection as below

UniConnection.DataTypeMap.AddDBTypeRule(msDecimal, 0, 0, ftBCD, 12, True);

The fields are created as BCDField working perfectly.
However, when making an "insert" the command is generated with float parameters and not as money.

exec sp_executesql N'INSERT INTO UniTeste
(n2, n4, n6, f)
VALUES
(@P1, @P2, @P3, @P4)',N'@P1 float,@P2 float,@P3 float,@P4 float',0.349999999999,0.349999999999,0.349999999999,0.349999999999


What configuration can I do to modify the parameters generated in the INSERT \ UPDATE commands com money datatype
?

Exemple:
exec sp_executesql N'INSERT INTO UniTeste
(n2, n4, n6, f)
VALUES
(@P1, @P2, @P3, @P4)',N'@P1 money,@P2 money,@P3 money,@P4 money',$0.3500,$0.3500,$0.3500,$0.3500


regards,
Fontenele

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

Re: SQL Server Map Decimal to BCD

Post by Stellar » Fri 09 Oct 2020 10:12

Unfortunately, we couldn't reproduce the issue. To investigate this behavior of UniDAC, please compose a full 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