Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/05/2006, 16:33
carazas
 
Fecha de Ingreso: mayo-2006
Mensajes: 16
Antigüedad: 18 años
Puntos: 0
Exclamación Problemas con PostgreSQL

Hola estoy trabajando sobre el servidor de base de datos PostgreSQL, es muy bueno pero no encuentro muchos manuales de como crear funciones en PLPGSQL
ahora bien tengo la siguiente funcion en Postgres:
CREATE OR REPLACE FUNCTION PROBAR () RETURNS SETOF RECORD AS
$$
DECLARE
REC RECORD;
REC_B RECORD;
BEGIN
FOR REC IN select * from impuestos LOOP
RETURN NEXT REC;
END LOOP;
RETURN;
END;
$$
LANGUAGE 'PLPGSQL' VOLATILE

y me da el siguiente error cuando quiero ejecutarlo:

ERROR: set-valued function called in context that cannot accept a set
CONTEXT: PL/pgSQL function "probar" line 6 at return next

si alguien podria ayudarme.....