Re: Problem with FOR LOOP query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem with FOR LOOP query
Дата
Msg-id 2449.1168547192@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problem with FOR LOOP query  ("Greg Quinn" <greg@officium.co.za>)
Список pgsql-novice
"Greg Quinn" <greg@officium.co.za> writes:
> In my function I am trying to declare a variable of type RECORD.
> DECLARE curRecord RECORD;
> But it gives an error.

Worksforme.  You really need to provide a complete example and the
specific error you're getting if you want useful help.

> It also doesn't like my FOR LOOP

> FOR curRecord IN SELECT messageid from email_inbox where folderid = $1 LOOP
>     EXECUTE sp_deleteemailinboxmessagetodeleteditems(curRecord.messageid);
> LOOP;

I think the problem is the last line has to be END LOOP; ... though
again the specific text of the error would have made diagnosis a lot
more certain.

            regards, tom lane

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

Предыдущее
От: "Greg Quinn"
Дата:
Сообщение: Problem with FOR LOOP query
Следующее
От: "Alan T. Miller"
Дата:
Сообщение: grabbing id of previous and next record for current select