This is a migrated thread and some comments may be shown as answers.

Oracle Tree loading Feature

1 Answer 57 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ibrahim Imam
Top achievements
Rank 1
Ibrahim Imam asked on 28 Apr 2011, 02:59 PM
Hello,

there is a way to support statements like the appended sample including "start with", "connect by prior" functionality using OpenAccess?

SELECT 

 

 

FOLDER_ID

FROM WN_FOLDER 

 

WHERE ORG_ID = pOrgId

START WITH FOLDER_ID = pObjectId

CONNECT BY FOLDER_ID = PRIOR PARENT_ID AND ORG_ID = pOrgId

 

AND PARENTORG_ID = pOrgId

BR

 

 

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 03 May 2011, 05:19 PM
Hello Ibrahim Imam,

In the latest version of the product we have introduced a new extension method which you can use to write manually backend specific SQL. Such query would look like this:
var result = context.WnFolders.Where(x => "WHERE ORG_ID = pOrgId START WITH FORDER_ID = pObjectId CONNECT BY FOLDER_ID = PRIOR PARENT_ID AND ORG_ID = pOrgId AND PARENTORG_ID = pOrgId".SQL<bool>()).Select(y => y.FolderId).ToList();

If you need to pass parameters, for example if pOrgId is a variable, you can substitute pOrgId with {0} in the string and call SQL<bool>(pOrgId).
Note that you need to include the Telerik.OpenAccess namespace in order to see the SQL<T> extension method.
I hope that helps.

All the best,
Alexander
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
Tags
LINQ (LINQ specific questions)
Asked by
Ibrahim Imam
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or