0

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

3
  • do you have some example of working with c# and plsql cursor? because i have posted question recently nobody answered Commented Jan 13, 2010 at 13:48
  • Can you show me some c# sample? Because I have problem with reading from Cursor with DataReader. There ara many examples with DataAdapter but none with DataReader. Thanx in advance. Commented Jan 13, 2010 at 14:10
  • I'm using a DataAdapter.Fill() method to fill a DataTable with the cursor. Commented Jan 13, 2010 at 14:25

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

2 Comments

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().
view my topic there are some explorations about it stackoverflow.com/questions/2037000/c-and-postgresql

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.