Este es el store procedure no se porque arriba sale tan mal
Código SQL
[-]create or alter procedure SP_FLUJO_EFECTIVO (
ANIO integer)
returns (
KEY_FLUJO integer,
NOMBRE_CUENTA varchar(200),
CUENTA varchar(50),
MONTO numeric(15,2),
LISTA varchar(100),
LISTA2 varchar(10))
as
begin
FOR select x.key_flujo, x.nombre_cuenta, X.cuenta,x.cuentas_afectan
from flujo_efectivo x where x.key_flujo=172 into :key_flujo,:nombre_cuenta,:cuenta,:lista Do
Begin
select sum(d.debe-d.haber)
from cab_diario c ,det_diario d
where c.key_cab_diario=d.key_cab_diario
and c.estado='T'
and extract(year from c.fecha_diario)=:anio
and d.key_plan_ctas in (:lista) into :monto ;
suspend;
End
end