Hi,
Does anyone have any code examples of returning multiple ref cursors? I can return one OK.
cheers,
Simon.
Returning Multiple Ref Cursors from a Stored Procedure
-
- Posts: 8
- Joined: Wed 17 Mar 2010 14:12
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
For example, you may use a stored procedure with several out cursor parameters, like the following:
Please specify if this helped.
Code: Select all
PROCEDURE GetDeptsAndEmps (dCur OUT SYS_REFCURSOR, eCur OUT SYS_REFCURSOR) AS
BEGIN
OPEN dCur FOR SELECT * FROM dept;
OPEN eCur FOR SELECT * FROM emp;
END;
-
- Posts: 8
- Joined: Wed 17 Mar 2010 14:12
Ok. But that is plsql code. I know how to do that. But what should the code look like on the C# side?
For instance, One value type works fine like this:
var q = db.PrProgramsSearch(search_string
, search_category
, "score_1" // not currently used by SP
, "desc" // not currently used by SP
, 1 // Which Page to return
, 30 // Records per page.
, ref all_programs_count_out // a count of all programs
, ref university_count_out);
var r = q.ToList();
RefCurRepeater.DataSource = r;
RefCurRepeater.DataBind();
But when I add a second "Value Type" in the designer which is based on a View like the first one, I get a compilation error:
Error 2 The type or namespace name 'ResultTypeAttribute' does not exist in the namespace 'Devart.Data.Linq.Mapping' (are you missing an assembly reference?) C:\dev\svn3\branches\linq\studdex\App_Code\DataContext.Designer.cs 189 35 C:\...\studdex\
This is using 5.55.97.0 Beta
And then when I use 5.60.102 Beta (03-Mar-2010) the same code gives:
{"Method 'get_TypeProvider' in type 'Devart.Data.Oracle.Linq.Provider.OracleDataProvider' from assembly 'Devart.Data.Oracle.Linq, Version=1.0.28.0, Culture=neutral, PublicKeyToken=09af7300eec23701' does not have an implementation.":"Devart.Data.Oracle.Linq.Provider.OracleDataProvider"}
By the way, i uninstalled, deleted all the devart program files (except dbmonitor) checked the GAC was empty and then reinstalled. I still get the same get_TypeProvided error.
For instance, One value type works fine like this:
var q = db.PrProgramsSearch(search_string
, search_category
, "score_1" // not currently used by SP
, "desc" // not currently used by SP
, 1 // Which Page to return
, 30 // Records per page.
, ref all_programs_count_out // a count of all programs
, ref university_count_out);
var r = q.ToList();
RefCurRepeater.DataSource = r;
RefCurRepeater.DataBind();
But when I add a second "Value Type" in the designer which is based on a View like the first one, I get a compilation error:
Error 2 The type or namespace name 'ResultTypeAttribute' does not exist in the namespace 'Devart.Data.Linq.Mapping' (are you missing an assembly reference?) C:\dev\svn3\branches\linq\studdex\App_Code\DataContext.Designer.cs 189 35 C:\...\studdex\
This is using 5.55.97.0 Beta
And then when I use 5.60.102 Beta (03-Mar-2010) the same code gives:
{"Method 'get_TypeProvider' in type 'Devart.Data.Oracle.Linq.Provider.OracleDataProvider' from assembly 'Devart.Data.Oracle.Linq, Version=1.0.28.0, Culture=neutral, PublicKeyToken=09af7300eec23701' does not have an implementation.":"Devart.Data.Oracle.Linq.Provider.OracleDataProvider"}
By the way, i uninstalled, deleted all the devart program files (except dbmonitor) checked the GAC was empty and then reinstalled. I still get the same get_TypeProvided error.
I have succeeded in executing a procedure returning two rowsets and having one IN and one OUT parameter
using the latest 5.60.102 Beta build of dotConnect for Oracle.
Here is the code:
using the latest 5.60.102 Beta build of dotConnect for Oracle.
Here is the code:
Code: Select all
int a = 9;
double? b = null;
var q = db.PassTworowsetsTest1(a, out b);
List depts = q.GetResult().ToList();
List emps = q.GetResult().ToList();