Cursor Error - Mailing list pgsql-sql

From La Chi
Subject Cursor Error
Date
Msg-id 1333445004.77078.YahooMailNeo@web162202.mail.bf1.yahoo.com
Whole thread Raw
List pgsql-sql
Hello every one

i have created this function to test cursors , but when i execute this funtion it give me this error , how can i fix this error

CREATE OR REPLACE FUNCTION foo(custid int) returns table(userid int) as
$BODY$

DECLARE rs cursor for Select customer_name from customer;

BEGIN
fetch forward 5 in rs;
 
END;
$BODY$
LANGUAGE plpgsql;

error--

ERROR:  syntax error at or near ";"
LINE 7:  fetch forward 5 in rs;
                              ^

********** Error **********

ERROR: syntax error at or near ";"
SQL state: 42601
Character: 172

pgsql-sql by date:

Previous
From: La Chi
Date:
Subject: How to write cursors
Next
From: Jasen Betts
Date:
Subject: Re: Wrong output from union