views:

193

answers:

1

Hi, 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 cursor. 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

A: 

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

TGadfly
But how? I use a OracleRefCursor object to store the cursor but there is no such ting as a close method on this object. Only a dipose().
Frank
view my topic there are some explorations about it http://stackoverflow.com/questions/2037000/c-and-postgresql
TGadfly