how to write cursors

Поиск
Список
Период
Сортировка
От La Chi
Тема how to write cursors
Дата
Msg-id 1333524628.40393.YahooMailNeo@web162203.mail.bf1.yahoo.com
обсуждение исходный текст
Ответы Re: how to write cursors  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-sql
hi every one

i have created this simple function which returns a column of table , i have used simple SELECT statement , i simply want to know how can i achieve the same task with the help of cursor

CREATE OR REPLACE FUNCTION foo(id int)
returns table(cust_id int) as
$BODY$

BEGIN
       
return query Select userid from customer where proname ='shampoo';
END;
$BODY$
LANGUAGE plpgsql;

how can i write a cursor which should return all the custid who had proname shampoo . i shall be very thankful to you 

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

Предыдущее
От: msi77
Дата:
Сообщение: Re: Duplicate information in parent and child tables
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: how to write cursors