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