plpgsql assigning RECORD := RECORD

Поиск
Список
Период
Сортировка
От bsides2@hotmail.com (MK)
Тема plpgsql assigning RECORD := RECORD
Дата
Msg-id 3eb0886f.0409150029.321cbc1e@posting.google.com
обсуждение исходный текст
Ответы Re: plpgsql assigning RECORD := RECORD
Список pgsql-general
Hi all,

I have a question regarding the RECORD type in plpgsql functions.

How do I assign a RECORD variable to another RECORD variable?

For example,

DECLARE
rs1 RECORD;
rs2 RECORD;
BEGIN

FOR rs1 IN SELECT * FROM mytable LOOP

  rs2 := rs1; --IS THIS POSSIBLE!?
END LOOP;
END;

When executing my function I  receive 'syntax error at or near "rs2"'.
So, obviously my syntax is not correct. Is there another way to
perform this?

In my loop I need to have access to the PREVIOUS record. There are A
LOT of fields being selected so storing each in its own variable is
not a desirable solution.

Any ides?

Thanks in advance

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

Предыдущее
От: Vincent.Desloges@alcatel.fr
Дата:
Сообщение: support on postgres
Следующее
От: tmp
Дата:
Сообщение: Re: psql + autocommit