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

Call Simple Stored Procedure (Oracle)

1 Answer 107 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ET
Top achievements
Rank 1
ET asked on 19 Feb 2010, 07:15 PM
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 :

scope.GetSqlQuery("DO_IT"nullnull).Execute(); 

AND

scope.GetSqlQuery<object>("DO_IT"null).ExecuteDirect(null); 

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?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 25 Feb 2010, 09:42 AM
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.

Regards,
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.
Tags
General Discussions
Asked by
ET
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or