Using stored procedure in LinqConnect DataContext
Posted: Mon 04 Jun 2012 12:37
Hi I am trying to evaluate dotConnect for Oracle and have a question about calling stored procedures from the dbcontext.
I have created a LinqConnect DataContext (.lqml) file from my oracle db and included a table and a couple of stored procedures in the model.
when I call one of the stored procedures from the db context
public List<GETALLPUBDATEResult> GetDbAllPubDates()
{
MDPDataContext db = new MDPDataContext();
List<GETALLPUBDATEResult> pubDatesArray;
var pubDates = db.GETALLPUBDATE();
pubDatesArray = pubDates.ToList<GETALLPUBDATEResult>();
return pubDatesArray;
}
I get the following error in the stored procedure:
PLS-00306: wrong number or types of arguments in call to 'GETALLPUBDATES'
I know it is something to do with the REF_CURSOR (which is the only parameter in the stored Procedure) that should be returned from the SP.
This is the code that is created in the DataContext1.Designer.cs file
[Function(Name=@"MDP.GETALLPUBDATES")]
public Devart.Data.Linq.ISingleResult<GETALLPUBDATEResult> GETALLPUBDATE()
{
IExecuteResult _GETALLPUBDATEResult = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
return ((Devart.Data.Linq.ISingleResult<GETALLPUBDATEResult>)(_GETALLPUBDATEResult.ReturnValue));
}
Can you please let me know if there is something I have failed to do? In the Model Explorer pane the method 'GETALLPUBDATE()' has no input parameters? and the return type is 'Value Types' GETALLPUBDATEResult.
many thanks
James
I have created a LinqConnect DataContext (.lqml) file from my oracle db and included a table and a couple of stored procedures in the model.
when I call one of the stored procedures from the db context
public List<GETALLPUBDATEResult> GetDbAllPubDates()
{
MDPDataContext db = new MDPDataContext();
List<GETALLPUBDATEResult> pubDatesArray;
var pubDates = db.GETALLPUBDATE();
pubDatesArray = pubDates.ToList<GETALLPUBDATEResult>();
return pubDatesArray;
}
I get the following error in the stored procedure:
PLS-00306: wrong number or types of arguments in call to 'GETALLPUBDATES'
I know it is something to do with the REF_CURSOR (which is the only parameter in the stored Procedure) that should be returned from the SP.
This is the code that is created in the DataContext1.Designer.cs file
[Function(Name=@"MDP.GETALLPUBDATES")]
public Devart.Data.Linq.ISingleResult<GETALLPUBDATEResult> GETALLPUBDATE()
{
IExecuteResult _GETALLPUBDATEResult = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())));
return ((Devart.Data.Linq.ISingleResult<GETALLPUBDATEResult>)(_GETALLPUBDATEResult.ReturnValue));
}
Can you please let me know if there is something I have failed to do? In the Model Explorer pane the method 'GETALLPUBDATE()' has no input parameters? and the return type is 'Value Types' GETALLPUBDATEResult.
many thanks
James