开发者

C# and PlSql Cursor

I have a Pl/Sql procedure signature that look like this

foo(param1 IN type1, param2 IN type1, c OUT REF CURSOR).

This stored procedure is being called in C#. In the C# code, I fill a DataTable with this cu开发者_运维知识库rsor. I would like to know when the cursor will be closed.

Should I close it in the SP? In the code? Or is the object OracleRefCursor will close it when I'll call the Dispose method(cause it has no Close method)?

Thanks

Edit : Here is some example of the code I'm using

Stored proc :

create or replace procedure foo1(param1 IN type1, param2 IN type1, c OUT REF CURSOR)
IS
BEGIN
    OPEN c
    FOR
       SELECT x
       FROM table;
END;

create or replace procedure foo2(param3 IN type1, param4 IN type1, c OUT REF CURSOR)
IS
   temp type1 := param3;
   x type1;
BEGIN
   LOOP temp < param4
      foo1(temp, param4, c);
      FETCH c INTO x;
      temp := temp +1;
   END LOOP;
END;

Thanks


You should not close cursor because no data will be returned, you have to close it in your c# code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜