Oracle type mapping

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
KLGregor
Posts: 3
Joined: Tue 17 Apr 2012 11:04

Oracle type mapping

Post by KLGregor » Tue 17 Apr 2012 11:50

I have two types in my oracle database:

Code: Select all

CREATE OR REPLACE TYPE "R_FLOAT_LIST" AS OBJECT
(
  val FLOAT
)
and

Code: Select all

CREATE OR REPLACE TYPE "T_FLOAT_LIST" AS TABLE OF R_FLOAT_LIST
And I have a function

Code: Select all

  FUNCTION TEST(P_QTY INTEGER) RETURN T_FLOAT_LIST IS
    RESULT T_FLOAT_LIST := T_FLOAT_LIST();
  BEGIN
    SELECT R_FLOAT_LIST(LEVEL)
    BULK COLLECT INTO RESULT
    FROM DUAL
    CONNECT BY LEVEL <= P_QTY;
    
    RETURN(RESULT);
  END;
When I am trying to add it to my Entity Model I am getting an error “Cannot create method for storage function ‘TEST’ than can be composed. Only stored procedures may be mapped.”
When I am trying to add it a storage model I get an error «The Type TABLE is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification.»
How can I map my function and my type into the Entity Model?

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 19 Apr 2012 15:16

KLGregor wrote:How can I map my function and my type into the Entity Model?
There is no way because it returns non-primitive Oracle type. Non-primitive types are not supported in Entity Framework. But you can reconstruct your function to return Oracle cursor as it is described at our blog: http://www.devart.com/blogs/dotconnect/ ... rsors.html.

Post Reply