Re: Loop through records

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Loop through records
Дата
Msg-id 27663.1131809406@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Loop through records  (Emiliano Amilcarelli <amiemi@tin.it>)
Список pgsql-novice
Emiliano Amilcarelli <amiemi@tin.it> writes:
> I managed to get results printed out from the function,

What was the problem exactly?  I couldn't see a reason for that error
message --- the only thing I could find wrong in your function was
spelling ">=" with a space in the middle.  After fixing that and making
a simple ERRORS table, it worked fine.

> but now i cannot If..THEN working inside the same function.

It looks like you're expecting FOUND to be set inside the loop, which it
is not.  Seems rather pointless --- if you're inside the loop body at
all, then it found a record, no?  A FOR-loop sets FOUND *when it exits*,
to tell code after the loop whether any iterations were performed or
not.

            regards, tom lane

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

Предыдущее
От: Emiliano Amilcarelli
Дата:
Сообщение: Re: Loop through records
Следующее
От: Reed Kempf
Дата:
Сообщение: postgresql database password