Returning Multiple Ref Cursors from a Stored Procedure

Returning Multiple Ref Cursors from a Stored Procedure

Postby simonredfern » Wed 17 Mar 2010 14:40

Hi,

Does anyone have any code examples of returning multiple ref cursors? I can return one OK.

cheers,

Simon.
simonredfern
 
Posts: 8
Joined: Wed 17 Mar 2010 14:12

Postby StanislavK » Thu 18 Mar 2010 13:34

For example, you may use a stored procedure with several out cursor parameters, like the following:
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;

Please specify if this helped.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby simonredfern » Mon 22 Mar 2010 16:46

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.
simonredfern
 
Posts: 8
Joined: Wed 17 Mar 2010 14:12

Postby AndreyR » Tue 23 Mar 2010 13:38

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:
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();
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for Oracle