mmarencibia@yahoo.es (Marcos Medina) writes:
> I wrote the following:
> CREATE OR REPLACE FUNCTION escritorio.seq_valor_actual( text)
> DECLARE
> ...
> actual integer;
> BEGIN
> ...
> FOR actual IN EXECUTE v_query LOOP
The loop variable has to be a record or row variable, not an integer.
FWIW, 7.5 will give a better error message for this common mistake.
In CVS tip I get
ERROR: loop variable of loop over rows must be a record or row variable at or near "LOOP" at character 416
LINE 14: FOR actual IN EXECUTE v_query LOOP
^
regards, tom lane