Hi!
Who can send me an expample of a postgres stored procedure that return a recordset....
I found this syntax:
----------------------------
CREATE FUNCTION reffunc2() RETURNS refcursor AS'
DECLARE
ref refcursor;
BEGIN
OPEN ref FOR SELECT * FROM t1;
RETURN ref;
END;
'LANGUAGE 'plpgsql';
----------------------------
when I create this... works, but when i try to use it:
select reffunc2();
that's the result:
reffunc2
--------------------
<unnamed cursor 1>
(1 row)
----------------------------
who can help me??
Who can send me an expample of a postgres stored procedure that return a recordset....
I found this syntax:
----------------------------
CREATE FUNCTION reffunc2() RETURNS refcursor AS'
DECLARE
ref refcursor;
BEGIN
OPEN ref FOR SELECT * FROM t1;
RETURN ref;
END;
'LANGUAGE 'plpgsql';
----------------------------
when I create this... works, but when i try to use it:
select reffunc2();
that's the result:
reffunc2
--------------------
<unnamed cursor 1>
(1 row)
----------------------------
who can help me??