Cannot set the parameter value AsCurrency

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
z.alex
Posts: 1
Joined: Fri 16 Jan 2009 12:48

Cannot set the parameter value AsCurrency

Post by z.alex » Fri 16 Jan 2009 13:04

Hi All, Hi Team!
I can't set the field value by using AsCurrency.
The field type is decimal(15,4).
var cc : currency;
begin
...
...ParamByName('my_field').AsCurrency := cc;

'invalid internal field type $C (12)' error

but .AsFloat all right!

IMHO need add case for 12 in function ConvertInternalTypeMySQLFormat(const InternalType: word): TMySqlFieldType in MySqlApiUni unit;
etc...

Thanks

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 19 Jan 2009 12:58

To solve the problem try to set the TUniQuery.Options.EnableFMTBCD property to True.

TheJohn
Posts: 1
Joined: Tue 19 Mar 2013 09:42

Re: Cannot set the parameter value AsCurrency

Post by TheJohn » Tue 19 Mar 2013 09:51

Hi,

I've got the same message with Unidac 4.1.4 for RAD Studio 2010 connected to a MySQL 5.5 database. I want to insert a record that contains DECIMAL(18,4) fields by using a prepared TUniQuery (I tried TUniSQL too). I put the value to the parameters and execute it.
I've tried set EnableBCD and/or EnableFMTBCD to true and use AsFloat or AsBcd but it doesn't work.

Thanks for help.

DemetrionQ
Devart Team
Posts: 271
Joined: Wed 23 Jan 2013 11:21

Re: Cannot set the parameter value AsCurrency

Post by DemetrionQ » Fri 22 Mar 2013 14:16

Hello.

I couldn't reproduce the problem when using TParam.AsFloat and TParam.AsBcd . Please send me (to dmitryk*devart*com) the full error message text, the script for creating the table, and a small sample demonstrating the problem.

Post Reply