How to use stored procedures through a Domain Model

4 posts, 0 answers
  1. Richard Koslik
    Richard Koslik avatar
    71 posts
    Member since:
    Apr 2010

    Posted 23 Sep 2010 Link to this post

    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
  2. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 24 Sep 2010 Link to this post

    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
  3. DevCraft banner
  4. Richard Koslik
    Richard Koslik avatar
    71 posts
    Member since:
    Apr 2010

    Posted 24 Sep 2010 Link to this post

    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 
  5. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 27 Sep 2010 Link to this post

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