How to write cursors

Поиск
Список
Период
Сортировка
От La Chi
Тема How to write cursors
Дата
Msg-id 1333439060.57914.YahooMailNeo@web162204.mail.bf1.yahoo.com
обсуждение исходный текст
Список pgsql-sql
Hello everyone,

i have created this function in which i simply want to display a column values through a cursor , but unfortunately i am not getting the column values , this function is showing me simple column name but not the  fields in column.

CREATE OR REPLACE FUNCTION foo(id int) returns table(user_id int) as
$BODY$
DECLARE r int;
DECLARE rs cursor for Select userid from customer where area ='new_york';
BEGIN
open rs ;
fetch next from rs into r;
while (found) loop
fetch Next from rs into r;
END loop; 
close rs;  
END;
$BODY$
LANGUAGE plpgsql;


i simply want to show all the record from customer table where area is New York but with the help of cursors.
thanks

В списке pgsql-sql по дате отправления:

Предыдущее
От: Gary Stainburn
Дата:
Сообщение: Re: Wrong output from union
Следующее
От: La Chi
Дата:
Сообщение: Cursor Error