Re: How to run loop in psql?

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: How to run loop in psql?
Дата
Msg-id 20100615115133.GE10637@a-kretschmer.de
обсуждение исходный текст
Ответ на How to run loop in psql?  (A B <gentosaker@gmail.com>)
Ответы Re: How to run loop in psql?  (A B <gentosaker@gmail.com>)
Список pgsql-novice
In response to A B :
> Hello there.
>
> Perhaps I'm supposed to know this, but how can I run a function on
> each query result in psql?
>
> I run the query  select a,b from foo where x=y; and I would like to
> run the function bar(u,v) for each result from the query and using
> the values of a and b as parameters to the function.
> How can I do that in psql?
>
>
> Something like:
>
> for x in select a,b from foo where x=y loop
>     select bar(x.a,x.b);
> end loop;

select bar(a,b) from foo where x=y


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

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

Предыдущее
От: A B
Дата:
Сообщение: How to run loop in psql?
Следующее
От: A B
Дата:
Сообщение: Re: How to run loop in psql?