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

Can't use function from Database

2 Answers 75 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Saeid
Top achievements
Rank 1
Saeid asked on 19 Apr 2013, 02:45 PM
Hi

I want to create entities from oracle database but I can't see any database functions in my schema??!!
I can select store procedure but where is functions?

2 Answers, 1 is accepted

Sort by
0
Doroteya
Telerik team
answered on 24 Apr 2013, 02:06 PM
Hi Saeid,

Currently, the scenarios with database functions in Oracle are not fully supported on our side and the improvements are already in our TODO list. 

For the time being, I would suggest that you try the following workaround:
1) Add the function to a package in order for it to appear under the Stored Procedures and Functions node in the Choose Database Items dialogue
2) Update the model with the function
3) Extend the context class in a partial class and place the method for the function there. The database functions are executed with the ExecuteQuery<T>() method of the context. Note that the sqlQueryString for calling functions in Oracle would be:
SELECT <function_name>(<list_of_parameters>) FROM dual

For your convenience, I have prepared a small sample project that illustrates the workaround. Please kindly find it attached to this message.

Since the creation of the actual method strongly depends on the function itself, do not hesitate to get back to us, if you experience any difficulties with that.

 

Greetings,
Doroteya
the Telerik team
Using Encrypted Connection Strings with Telerik OpenAccess ORM. Read our latest blog article >>
0
Doroteya
Telerik team
answered on 24 Apr 2013, 02:33 PM
Hello Saeid,

In addition, we tested a scenario when the function is not included in a package and therefore is not present in the model. It turns out that you will be able to execute the function with only step 3 from the suggested solution where the context is extended in a partial class and a method for the function is created.

I am looking for your feedback in case of additional questions.


Kind regards,
Doroteya
the Telerik team
Using Encrypted Connection Strings with Telerik OpenAccess ORM. Read our latest blog article >>
Tags
Getting Started
Asked by
Saeid
Top achievements
Rank 1
Answers by
Doroteya
Telerik team
Share this question
or