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