mmarencibia (AT) yahoo (DOT) es (Marcos Medina) writes:
Quote:
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
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match