Page 1 of 1

Retrieving Ref Cursors

Posted: Wed 05 Nov 2008 07:53
by chandrasekhar
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

Posted: Wed 05 Nov 2008 14:04
by AndreyR
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.

Posted: Thu 06 Nov 2008 06:37
by chandrasekhar
Hi Andrey,

That worked.Thanks a lot for the information.