Habría que ver cómo es ese procedimiento. Tendrías que ver si puedes aplicar esta idea a tu procedimiento:
Código SQL
[-]
declare variable importe double precision;
begin
for select importe from tabla
where ...
into :importe
do
begin
update totales
set importe=importe + :importe
where ...;
end
end
Código SQL
[-]
declare variable importe double precision;
declare variable total double precision;
begin
for select importe from tabla
where ...
into :importe
do
begin
Total = Total + importe;
end
update totales
set importe=total
where ...;
end