Can't use function from Database

3 posts, 0 answers
  1. Saeid
    Saeid avatar
    7 posts
    Member since:
    Jan 2012

    Posted 19 Apr 2013 Link to this post

    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. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 24 Apr 2013 Link to this post

    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 >>
  3. DevCraft banner
  4. Doroteya
    Admin
    Doroteya avatar
    502 posts

    Posted 24 Apr 2013 Link to this post

    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 >>
Back to Top