3 Replies Latest reply: Dec 13, 2012 1:17 PM by 15208 RSS

    Are there limitations to EF query functions when connecting to Oracle?

    977106
      We are in the process of comparing pros and cons of ODP.NET and Devart's docConnect for Oracle. We are trying to figure out whether or not we will be able to run our EF queries. We have a type of query that fails with Devart's data provider and they claim it is an Oracle limitation.

      Is there a limitation of Oracle that causes the following query to throw an error? If so, how would one go about restructuring the query to get the same result from Oracle?

      var entityFields = _Context.Fields
      .Where(f => f.ObjectFields
      .Any(otf => otf.Object.Things
      .Any(p => p.ThingID == thingID))
      && f.Definitions.Any())
      .Select(f=>f.FieldID)
      .ToList();

      TRANSLATES TO:

      CODE: SELECT ALL
      SELECT "Extent1"."FieldID" FROM "Field" "Extent1"
      WHERE (
      EXISTS (
      SELECT 1 AS C1 FROM (
      SELECT "Extent2"."ObjectID"
      FROM "ObjectField" "Extent2"
      WHERE "Extent1"."FieldID" = "Extent2"."FieldID" )
      "Project1"
      WHERE EXISTS (
      SELECT 1 AS C1 FROM "Thing" "Extent3"
      WHERE ("Project1"."ObjectID" = "Extent3"."ObjectID")
      AND ("Extent3"."ThingID" = :p__linq__0) ) ))
      AND (
      EXISTS (
      SELECT 1 AS C1 FROM "Definition" "Extent4"
      WHERE "Extent1"."FieldID" = "Extent4"."FieldID" ))