Call Simple Stored Procedure (Oracle)

Thread is closed for posting
2 posts, 0 answers
  1. ET
    ET avatar
    4 posts
    Member since:
    Feb 2010

    Posted 19 Feb 2010 Link to this post

    What is the proper way to invoke a simple (no in param, no out param, no resultset)  stored procedure?

    The DB I'm using is Oracle and I've tried :




    The first call does not throw, but it also does not work (no db change).
    The second actually executes the sproc (db changes) but throws an exception about the returned result set.

    What is the right approach? Am I missing a config setting?

  2. Damyan Bogoev
    Damyan Bogoev avatar
    581 posts

    Posted 25 Feb 2010 Link to this post

    Hi ET,

    In order to execute the first query you can call the Count property of the query result:
    IQueryResult result = scope.GetSqlQuery(“DO_IT”, null, null).Execute();
    int a = result.Count;//executes the query
    The reason is that the query is not actually executed until the result is used.

    On the other hand, the ExecuteDirect method executes the query and does not return a result. In this case you should use the ExecuteDirect without any parameters specified.
    Hope that helps.

    Damyan Bogoev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top