-1
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;

如何使用 2 个光标的名称和位置值?

4

1 回答 1

3

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

while (dr.Read())
{
  //first cursor goes here
}
if (dr.NextResult() == true)
{
  while (dr.Read())
  {
    //Second cursor goes here
  }
}
于 2012-05-10T10:58:03.497 回答