You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any ability to work with SQL refcursor type?
e.g. we have function returning refcursor with data we need to insert into the template: select Report0302.cCardStaff(idp, dpdate)
CREATE OR REPLACEFUNCTIONReport0302.cCardStaff(idp numeric, dpdate timestamp without time zone)
RETURNS refcursor
LANGUAGE plpgsql
AS $function$
declare
p_cursor refcursor;
begin
open p_cursor for
select AllRep.*from AllRep
where id = idp and dpdate between dbegin and dend
order by sLevel, nLevelOrder;
return p_cursor;
end;
$function$
;
now it results into the error ОШИБКА: курсор "<unnamed portal 1>" не существует Query: select Report0302.cCardStaff(?::numeric,sysdate()) Parameters: [1.0]
It is a simple example, in reality we have difficult logic with dynamically changing querys, so just taking select-part to insert into the reporting tool is not an option.
The text was updated successfully, but these errors were encountered:
Hi,
Is there any ability to work with SQL refcursor type?
e.g. we have function returning refcursor with data we need to insert into the template:
select Report0302.cCardStaff(idp, dpdate)
now it results into the error
ОШИБКА: курсор "<unnamed portal 1>" не существует Query: select Report0302.cCardStaff(?::numeric,sysdate()) Parameters: [1.0]
It is a simple example, in reality we have difficult logic with dynamically changing querys, so just taking select-part to insert into the reporting tool is not an option.
The text was updated successfully, but these errors were encountered: