Stored Procedure Returns Multiple Reference Cursors
Posted: Tue 19 Apr 2016 21:51
I have a stored procedure that returns 3 ref cursors. I am using PostgreSQL 9.5 with dotConnect for Postgres. I am trying to integrate the stored procedures / functions into the entity framework but whenever I try to create a method for the stored procedure I get the following error.
"Cannot create method for a storage function 'getpatientshapedata' that can be composed. Only stored procedure may be mapped'
For reference this is my stored procedure.
How can I create a method for calling this with the entity framework?
"Cannot create method for a storage function 'getpatientshapedata' that can be composed. Only stored procedure may be mapped'
For reference this is my stored procedure.
Code: Select all
CREATE OR REPLACE FUNCTION public.getpatientshapedata(p_shape_id int8, p_shape_cursor refcursor, p_shape_file_cursor refcursor, p_shape_modification_cursor refcursor)
RETURNS SETOF refcursor
AS
$BODY$
DECLARE
BEGIN
OPEN p_shape_cursor FOR
select * from patientshape where id = p_shape_id;
RETURN NEXT p_shape_cursor;
OPEN p_shape_file_cursor FOR
select * from patientshapefile where patientshapeid = p_shape_id;
RETURN NEXT p_shape_file_cursor;
OPEN p_shape_modification_cursor FOR
select * from patientshapemodification where patientshapeid = p_shape_id;
RETURN NEXT p_shape_modification_cursor;
END;
$BODY$
LANGUAGE plpgsql VOLATILE;