1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| BEGIN
FOR
select
d.date_bilan,
c.nom_unite,
b.nom_step,
d.volume_mj_sortie* d.nombre_jour_reel as Vol_Traite_Mois,
a.energie_active,
a.energie_reactive,
a.pma,
a.rap_puissance,
a.montant_facture,
a.energie_active / (cast(nullif(d.volume_mj_sortie,0) as integer) * d.nombre_jour_reel) as Taux_consommation
from tb_energie a
inner join tb_step b on (a.code_step = b.code_step)
inner join tb_unite c on (b.code_unite = c.code_unite)
inner join tb_process d on (b.code_step = d.code_step)
where
(
(a.date_mois =:DATE_BILAN_SAISIE and d.date_bilan =:DATE_BILAN_SAISIE )
)
into
:DATE_BILAN,
:NOM_UNITE,
:NOM_STEP,
:VOLUME_TRAITE_MOIS,
:ENERGIE_ACTIVE,
:ENERGIE_REACTIVE,
:PMA,
:RAP_PUISSANCE,
:MONTANT_FACTURE,
:TAUX_CONSOMMATION
DO
BEGIN
suspend;
END
END |
Partager