Re: syntax error during function call

Поиск
Список
Период
Сортировка
От Aycock, Jeff R.
Тема Re: syntax error during function call
Дата
Msg-id 65151B9A7C8C9C4284ABC85F0336DE5003972D69@0015-its-exmb11.us.saic.com
обсуждение исходный текст
Ответ на Re: syntax error during function call  (Raymond O'Donnell <rod@iol.ie>)
Список pgsql-general
Raymond,

I tried your suggestion but the result is the same when "whoami" is
declared at the top of the function and assigned inside the loop.

Thanks for the suggestion anyway.

-----Original Message-----
From: Raymond O'Donnell [mailto:rod@iol.ie]
Sent: Wednesday, January 27, 2010 11:00 AM
To: Aycock, Jeff R.
Cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] syntax error during function call

On 27/01/2010 15:40, Aycock, Jeff R. wrote:

> BEGIN
>
>     FOR r IN SELECT * FROM schema_1.snapshot_table
>
>     LOOP
>
>
>
>             DECLARE whoami text := r;


I could be wrong, but I don't think that the DECLARE inside the loop is
correct. I think you have to declare "whoami" with the rest of your
variables in the DECLARE block at the top of the function, and then you
can assign to it inside the loop.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie

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

Предыдущее
От: Vincenzo Romano
Дата:
Сообщение: Re: Variadic polymorpic functions
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: syntax error during function call