如何在asp.net中使用procedure(package)中的Multiple Cursor Output值

时间:2012-04-28 17:05:35

标签: c# asp.net oracle plsql

Procedure GetDetails( ID as Varchar2,
                       Cursor1 OUT Cursor_Type,
                        Cursor1 OUT Cursor_Type ) AS

BEGIN

       OPEN CURSOR1 FOR 
              Select Name from User where UserID=ID;

       OPEN CURSOR2 FOR 
               Select Place from Dept where DeptID=ID;

END GetDetails;

我如何使用Name&放置2个游标的值?

1 个答案:

答案 0 :(得分:3)

尝试使用DataReader.NextResult移动到下一个光标。例如:

while (dr.Read())
{
  //first cursor goes here
}
if (dr.NextResult() == true)
{
  while (dr.Read())
  {
    //Second cursor goes here
  }
}