Retrieving Ref Cursors

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
chandrasekhar
Posts: 2
Joined: Wed 05 Nov 2008 07:46

Retrieving Ref Cursors

Post by chandrasekhar » Wed 05 Nov 2008 07:53

Hi,

I have an oracle stored procedure that returns Ref Cursor

PROCEDURE getEmps
(cur_OUT OUT return_cur)
IS
BEGIN
OPEN cur_OUT FOR
SELECT empno,ename,job
FROM emp;
END;

When I add this sp to my sample EDM,the mode of the Ref Cursor:cur_OUT is always shown as "IN" and as such when I make a function import to the EDM,it is always taken as input parameter.

Has anyone tried using Ref Cursors in the EDM?If yes,please let me know the way to resolve this problem.

Thanks in advance,
Chandrasekhar M

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 05 Nov 2008 14:04

When you use SP with ref cursors, you should run the "Create Function Import" dialog and select the proper returning type (this should be an entity from the model). After this, if you execute the proper method in the code, the return value of the function wil contain the result of cursor executing. Set the In parameter corresponding to Out Cursor to null.

chandrasekhar
Posts: 2
Joined: Wed 05 Nov 2008 07:46

Post by chandrasekhar » Thu 06 Nov 2008 06:37

Hi Andrey,

That worked.Thanks a lot for the information.

Post Reply