Saludo lista
Quisiera saber si esta funcion se puede llevar a cabo, ya que de devulve un error:
ERROR: Set-valued function called in context that cannot accept a set
CREATE or replace FUNCTION public.fixcuenta(varchar) RETURNS SETOF public.cxcclient AS '
DECLARE
rec cxcclient%rowtype;
lc_codigo alias for $1;
xsaldo numeric(14,2) := 0;
BEGIN
FOR rec IN select * from cxcclient where id_cliente = lc_codigo order by doc_fecha LOOP
xsaldo := xsaldo + rec.valor;
update cxcclient set saldo=xsaldo where cxcclient.id_transac=rec.id_transac;
END LOOP;
RETURN;
END;' LANGUAGE 'plpgsql' VOLATILE;
Gracias por su atencion.
Henry O.Interiano.
San Pedro Sula, Honduras.