Page 1 of 1

Orcacle call function error

Posted: Fri 27 Oct 2017 04:34
by sysman
Hi
I want to call an oracle function from entity developer.
I wrote this command in "command text" property:

Code: Select all

SELECT FNC_SUM(1,2) 
FROM DUAL
but in running time I got this error:

Code: Select all

System.InvalidCastException: 'Invalid cast from 'System.Decimal' to 'System.Data.Metadata.Edm.PrimitiveType'.'
in model designer code:

Code: Select all

result = (global::System.Nullable<int>)command.ExecuteScalar();
how to solve this?

Re: Orcacle call function error

Posted: Wed 01 Nov 2017 13:36
by Shalex
Please set Return Type = Decimal in CSDL of *.edml via interface of Entity Developer to generate:

Code: Select all

result = (global::System.Nullable<decimal>)command.ExecuteScalar();
After this, the code should work.