Datagrip无法从光标读取以下查询:
SELECT public.get_user_summary('ALL');
FETCH ALL FROM ref1;
功能代码:
CREATE OR REPLACE FUNCTION public.get_user_summary(username text)
RETURNS refcursor AS
$BODY$
DECLARE ref1 refcursor := 'ref1';
BEGIN
OPEN ref1 FOR
select * FROM public.user_details where user_name=username;
RETURN ref1;
END
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
它适用于pgAdmin,但datagrip会给出以下错误:
<failed to load>
org.postgresql.util.PSQLException: ERROR: cursor "ref1" does not exist
有解决方法吗?