How to call an Oracle function with a Ref Cursor as Out-parameter from C#?

You sure can. There are a few gotchas to be wary of but here is a test case create or replace function testodpRefCursor( uniqueId IN NUMBER ,resultItems OUT NOCOPY SYS_REFCURSOR) RETURN NUMBER IS BEGIN OPEN resultItems for select level from dual connect by level < uniqueId ; return 1; END testodpRefCursor; I have found that … Read more

How to call Oracle Function or Procedure using Hibernate (EntityManager) or JPA

Oracle function or a stored procedure can be called using EntityManager in the following manner. For Oracle Function Create a function with sys_refcursor as return type CREATE OR REPLACE FUNCTION my_function (p_val IN varchar2) RETURN SYS_REFCURSOR AS my_cursor SYS_REFCURSOR; BEGIN OPEN my_cursor FOR SELECT emp_name FROM employees WHERE lower(emp_name) like lower(p_val||’%’); RETURN my_cursor; END; In … Read more