To anyone who can help me,
I am new at Postgresql and am having some problems.
I am trying to return a rowset from a function to the calling procedure.
Outside a function I have gotten this to work at the psql level.
-------------
BEGIN Work;
DECLARE Liahona CURSOR FOR Select * from users;
FETCH FORWARD ALL IN Liahona;
CLOSE Liahona;
COMMIT Work;
--------------
I went a stage further attempt to put this query into a function as such
--------------
CREATE FUNCTION getallusers() RETURN integer AS'
DECLARE
Liahona CURSOR FOR Select * from users;
BEGIN
FETCH FORWARD ALL IN Liahona;
CLOSE Liahona;
END;
'language 'plpgsql';
---------------
Followed by 'select getallusers();' for testing purposes.
I get the error:
ERROR during compile of getallusers near line 5
Parse error at or near "FORWARD"
I have tried creating RECORD type cursors but no luck.
Can anyone suggest how to do this.
I was referenced to this this through my discussion at dbforums.com.
Thanks
!-------------------------------------!
David Williams
Get more from the Web. FREE MSN Explorer download :
http://explorer.msn.com