Data type money/currency cannot be retourned in DA command

We have a DA command in a .NET server that returns a parameter of type currency.

However this variant parameter cannot be read as a currency in delphi.

It appears to be a byte array.

How do you return an MSSQL DB type money via a DA command to a delphi client

image

FYI: Another small inconvenience in the schema modeler is that when you change the select SQL statement above he asks to update the parameters and he changes the direction of all the output parameters (to input)

Hi,

EDIT:
This is as expected. .NET uses Decimal for Currency type so when it writes Variant value, it converts Decimal to Variant.

On Delphi side you can convert variant to Decimal with VariantToDecimal and later DecimalToBCD & BCDToCurrency or call VariantToBCD & BCDToCurrency methods

Logged as bugs://D19589.

Hi,

Can you give an example of such sql statement, pls?

Yes, the SQL from thes screenshot had it

Hi,

why do you want to consume select request as a set of parameters and not as usual fields?

I don’t understand your question.

In our code (historically) queries that return only a single record (and which don’t need updating) are typically implemented via commands.

What other approach do you suggest?

Hi,

Thx, for clarification.
by default, you can’t create Select statement in Commands so I’ve messed Tables and Command nodes.

Now I understand the issue but I don’t think that we can easily detect parameter’s direction but we can keep type/size/direction for known parameters.

btw, for tables (i.e. select sql) you can receive money type as currency, but for commands - all parameter values are passed as Variant from server to client so you have received money type as Variant (decimal is stored into variant as array of byte).

bugs://D19589 was closed as fixed.