Re: Attribute a value to a record

Поиск
Список
Период
Сортировка
От Albe Laurenz
Тема Re: Attribute a value to a record
Дата
Msg-id D960CB61B694CF459DCFB4B0128514C203938147@exadv11.host.magwien.gv.at
обсуждение исходный текст
Ответ на Re: Attribute a value to a record  (Florent THOMAS <mailinglist@tdeo.fr>)
Список pgsql-general
Florent THOMAS wrote:
> I understood that in the Loop you can change the values of a 
> variable! Exactly what I needed.
> but unfortunately all of this seems to be temporary. 
> Consequently, the record in the table won't be updated by the 
> changes we made on the local variable even if it points to a 
> record in the table.
> I forgot the aspect of the cursor that is temporary.

I get you now - you expected that the underlying table would
be updated if you change a variable in PL/pgSQL.

I don't think that you need dynamic SQL for that -
all it takes is an UPDATE statement in your loop, like

UPDATE XXX SET XXX.myfield = mynewvalue
   WHERE XXX.pkey = ventilation_local.pkey;

(using the names from your sample)

Yours,
Laurenz Albe

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Is it necessary to have index for child table in following case?
Следующее
От: "Wappler, Robert"
Дата:
Сообщение: Re: Attribute a value to a record