Page 1 of 1

Cannot set the parameter value AsCurrency

Posted: Fri 16 Jan 2009 13:04
by z.alex
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

Posted: Mon 19 Jan 2009 12:58
by Dimon
To solve the problem try to set the TUniQuery.Options.EnableFMTBCD property to True.

Re: Cannot set the parameter value AsCurrency

Posted: Tue 19 Mar 2013 09:51
by TheJohn
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.

Re: Cannot set the parameter value AsCurrency

Posted: Fri 22 Mar 2013 14:16
by DemetrionQ
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.