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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cursors in plpgsql functions

Status
Not open for further replies.

noonjy

Programmer
Mar 13, 2002
8
MY
Can I use cursors inside plpgsql functions?.

CREATE FUNCTION test() RETURNS text AS '
BEGIN
BEGIN WORK;
DECLARE emp_cur CURSOR FOR SELECT * FROM hpemployee;
FETCH FORWARD 2 FROM emp_cur;
CLOSE emp_cur;
COMMIT WORK;
END;
'language 'plpgsql';

The above code gives me error "parse error at or near by CURSOR"

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top