CREATE OR REPLACE PROCEDURE SampleProc1()
as $$
declare
c1 refcursor:='result1';
begin
open c1 for
select approverid,assigntoid,effstdt,effenddtfrom tblApproverreassign;
end;
$$
language plpgsql;
-------------------------------------------------------------------------------------------------------------
CREATE OR REPLACE PROCEDURE SampleProc2()
as $$
declare c1 refcursor:='result1';
begin
CREATE TEMP TABLE TMPApproverAssign
( approverid VARCHAR(10),
assigntoid VARCHAR(10),
effstdt timestamptz,
effenddt timestamptz
) ON COMMIT DROP;
INSERT INTO TMPApproverAssign
CALL SampleProc1();
open c1 for
select approverid,assigntoid,effstdt,effenddtfrom TMPApproverAssign;
end;
$$
language plpgsql;
---------------------------------------------------------------------------------------------
Error : syntax error at or near "CALL"
LINE 12 : ^CALL SampleProc1();
SQL state : 42601
Character:453
------------------------------------------------------------------