Oracle Ref Cursor Issue

Posts   
 
    
Rishi
User
Posts: 69
Joined: 31-Oct-2011
# Posted on: 02-Dec-2011 23:10:28   

Hi,

I am using LLBLGen V3.1, Oracle 11i and SQL 2008

I have mapped sql and oracle in same entity. I am having difficulties in mapping a store procedure of oracle database into entity.

I have store procedure defined as out parameter (Ref Cursor) in oracle and which is not defined in sql. So there is different number of parameters in sql and oracle.

So i am getting error because of different number of parameters in oracle and sql server database. Please guide me how to handle this kind of situation.

Thanks

Rishi

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 03-Dec-2011 03:19:28   

Hi Rishi,

At some point you can do nothing in the way the procedures are called. But you could write additional methods on Oracle DBSpecific ActionProcedures and RetrievalProcedures, inside that method you just call the normal procedure call and return the value, that would make both SQLServer and Oracle calls equal.

David Elizondo | LLBLGen Support Team
Rishi
User
Posts: 69
Joined: 31-Oct-2011
# Posted on: 05-Dec-2011 15:21:53   

Sorry, but i am not following you, can you explain me in detail how i can achieve this?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 06-Dec-2011 05:55:45   

Rishi wrote:

Sorry, but i am not following you, can you explain me in detail how i can achieve this?

Mmm. I mean that you can create wrapper methods to make the SP calls consistence between SQLServer and Oracle. But that depends on where you are getting the error:

Rishi wrote:

I have store procedure defined as out parameter (Ref Cursor) in oracle and which is not defined in sql. So there is different number of parameters in sql and oracle.

So i am getting error because of different number of parameters in oracle and sql server database. Please guide me how to handle this kind of situation.

You said you are getting errors. What errors and where? A typical RetrievalProcedure with ref_cursor looks like this in the generated code:


public static DataTable GetUserCompanies(System.String psUserName)
{
    using(DataAccessAdapter dataAccessProvider = new DataAccessAdapter())
    {
        return FcnGetUserCompanies(psUserName, dataAccessProvider);
    }
}


public static DataTable FcnGetUserCompanies(System.String psUserName, IDataAccessCore dataAccessProvider)
{
    using(StoredProcedureCall call = CreateFcnGetUserCompaniesCall(dataAccessProvider, psUserName))
    {
        DataTable toReturn = call.FillDataTable();
        return toReturn;
    }
}

... which should look very similar using SQLServer. So, where do you have those errors?

David Elizondo | LLBLGen Support Team