[Pgsql-ayuda] actualizar saldo

From: "Henry Orlando Interiano" <henry(at)lamundial(dot)hn>
To: <pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx>
Subject: [Pgsql-ayuda] actualizar saldo
Date: 2003-07-15 21:41:11
Message-ID: 005301c34b19$e0b41630$8900a8c0@yuja
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

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.

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2003-07-15 22:22:08 Re: [Pgsql-ayuda] Ayunda con Función
Previous Message Josué Maldonado 2003-07-15 21:40:14 Re: [Pgsql-ayuda] No puedo postear mensajes