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个游标的值?
答案 0 :(得分:3)
尝试使用DataReader.NextResult
移动到下一个光标。例如:
while (dr.Read())
{
//first cursor goes here
}
if (dr.NextResult() == true)
{
while (dr.Read())
{
//Second cursor goes here
}
}