Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Procedure return a recordset

Status
Not open for further replies.

crixo

Programmer
Jul 23, 2003
3
IT
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??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top