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

How to use stored procedures through a Domain Model

3 Answers 115 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.
Richard Koslik
Top achievements
Rank 1
Richard Koslik asked on 23 Sep 2010, 12:38 PM
Hello!

I tried to call a stored procedure in my programm through the DatabaseModel, but I always get the following NullReferenceException: "Object reference not set to an instance of an object."

I describe you the way how I tried:

1) Create an Oracle Procedure with one parameter (defined as OUT parameter) for getting back a result. (It's not possibly to use Oracle Functions)
2) Create a ORM Database Model (.rlinq) where I inserted my procedure. In the cs-File there was the following autogenerated code:
public object[] PCCHECKSESSIONS(string pSRESULT)
{
    SqlParameter parameterPSRESULT = new SqlParameter("PS_RESULT", OpenAccessType.Varchar, ParameterMode.Out);
         
    List<SqlParameter> sqlParameters = new List<SqlParameter>()
    {
        parameterPSRESULT
    };
             
    object[] queryResult = this.ExecuteStoredProcedure<object>("'PC_CHECK_SESSIONS' ?", sqlParameters ,pSRESULT);  
    return queryResult;
}
3) Now I tried to call my procedure via the databaseContext
string p_param = "";
var res = HugeObjectHolder.dbContext.PCCHECKSESSIONS(p_param);
4)When I now call the procedure I get the Errormessage (NullReferenceException: "Object reference not set to an instance of an object."
)

What do I have to do, that I can call my procedure and also get my OUT parameter????


Thanks for you answer.

Regards, Richard

3 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 24 Sep 2010, 09:07 AM
Hi Richard Koslik,

 We are aware of the out parameter problem in oracle. We have addressed that and you should be able to find it fixed in our next release. 
We are sorry for any inconvenience caused.

Greetings,
Petar
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
0
Richard Koslik
Top achievements
Rank 1
answered on 24 Sep 2010, 09:26 AM
Hello, 

thanks for your answer.

But if I don't use the OUT parameter, if I only want to call a procedure with no parameters I ALSO get the same exception. Is it generelly possible to call a stored procedure, so that it works????

Regards, Richard 
0
PetarP
Telerik team
answered on 27 Sep 2010, 02:37 PM
Hi Richard Koslik,

 Unfortunately with our latest release stored procedures in oracle have degraded. We are working on all the required fixes and they will be available in our next internal build/service pack. I will post here once the build is out.
Once again sorry for any inconvenience caused.

Sincerely yours,
Petar
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
Getting Started
Asked by
Richard Koslik
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Richard Koslik
Top achievements
Rank 1
Share this question
or