Ver Mensaje Individual
  #2  
Antiguo 08-10-2019
IVAND IVAND is offline
Miembro
 
Registrado: may 2003
Ubicación: ECUADOR
Posts: 523
Reputación: 21
IVAND Va por buen camino
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 ;
  /* Procedure Text */
  suspend;

 End
end
__________________
IVAND

Última edición por Casimiro Notevi fecha: 08-10-2019 a las 12:58:57.
Responder Con Cita