Cursor Error

Поиск
Список
Период
Сортировка
От La Chi
Тема Cursor Error
Дата
Msg-id 1333445004.77078.YahooMailNeo@web162202.mail.bf1.yahoo.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: La Chi
Дата:
Сообщение: How to write cursors
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: Wrong output from union