Page 1 of 1

Function imports

Posted: Fri 03 Apr 2009 10:59
by ies
Hi,
I'm trying to create a function import that return scalar value (Int32) and i received this error:
Error 2054: A FunctionImport is mapped to a storage function 'MyModel.Store.Function1' that can be composed. Only stored procedure functions may be mapped.

I have a same function that return a cursor and it works ok

what can i do?
________

Posted: Fri 03 Apr 2009 13:51
by AndreyR
One of the possible solutions for this problem is to use the following code:

Code: Select all

      using (Entities db = new Entities()){
        ObjectQuery query = new ObjectQuery("Model.Store.GetDecimal(@D)", db);
        query.Parameters.Add(new ObjectParameter("D", 1m));
        decimal result = query.ToList().FirstOrDefault();
      }

Posted: Mon 06 Apr 2009 08:02
by ies
Hi andrey,

I'm having a problem. I have a Package (PCK_1) with a function

FUNCTION f_p (
uno IN NUMBER,
dos IN NUMBER,
tres IN VARCHAR2
)
RETURN NUMBER
IS
BEGIN
RETURN 14;
END;

i try to call this function using ef but i have a error (ORA-00904: \"PCK_1_F_P\": identificador no v?lido):

using (Entities db = new Entities())
{

ObjectQuery query = new ObjectQuery("Model.Store.PCK_1_F_P(@a,@b,@c)", context);

query.Parameters.Add(new ObjectParameter("a", Convert.ToDecimal(1)));
query.Parameters.Add(new ObjectParameter("b", Convert.ToDecimal(2)));
query.Parameters.Add(new ObjectParameter("c", Convert.ToDecimal("1")));

decimal result = query.ToList().FirstOrDefault();
}

what is wrong?
________

Posted: Mon 06 Apr 2009 13:26
by AndreyR
Thank you for the report, we have reproduced this problem.
I will let you know about the results of our investigation.

Posted: Mon 06 Apr 2009 16:25
by ies
thanks andrey
________
How to steam food

Posted: Tue 05 May 2009 08:08
by ies
I Andrey,

I have install de latest version of connector (5.20.29), and i try to launch function import buy i'm having the same error

ORA-00904: \"PCK_1_F_P\": identificador no v?lido


what can i do?

thanks,
________
Glass Pipe Pictures

Posted: Wed 06 May 2009 12:38
by AndreyR
This problem was fixed. Look forward to the next build of dotConnect for Oracle.