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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
| CREATE PROCEDURE EXECUTE_TOUT (
date_debut date,
date_fin date,
step varchar(30),
code_point_prlv smallint)
returns (
ligne varchar(500) character set unicode_fss)
as
declare variable nom_step varchar(20);
declare variable ib integer;
declare variable nbr_ib integer;
declare variable nbr_ integer;
declare variable dco_dbo5 float;
declare variable interpretation_ib varchar(100);
declare variable effluent varchar(100);
declare variable ratio_boue float;
declare variable extration varchar(50);
BEGIN
LIGNE = 'PERIODE DU : ' || date_debut || ' AU : ' || date_fin;
SUSPEND;
LIGNE = '';
SUSPEND;
/******* Indice de boue ***************/
LIGNE = 'CALCUL DE L''INDICE_BOUE';
suspend;
FOR
SELECT nom_step,
avg(ib),
count(ib),
interpretation_ib
FROM "[10]PS_INDICE_BOUE"(:date_debut, :date_fin, :step, :code_point_prlv)
group by nom_step, interpretation_ib
INTO :nom_step,
:IB,
:nbr_ib,
:Interpretation_ib
DO BEGIN
LIGNE = 'STEP : ' || nom_Step || ' -- ' ||
'Val. IB : ' || IB || ' -- ' ||
'Fréq. IB : ' || nbr_ib || ' -- ' ||
'Interp. : ' || Interpretation_ib;
SUSPEND;
END
LIGNE = '';
SUSPEND;
/******* Ratio DCO / DBO5 ***************/
LIGNE = 'CALCUL DU RATIO DCO / DBO5';
SUSPEND;
FOR
SELECT nom_step,
count(ratio_dco_dbo5),
avg(ratio_dco_dbo5),
effluent
FROM "[10]PS_RATIO_DCO_DBO5"(:date_debut, :date_fin)
group by nom_step, effluent
INTO :nom_step,
:nbr_,
:dco_dbo5,
:effluent
DO BEGIN
LIGNE = 'STEP : ' || nom_Step || ' -- ' ||
'Fréq. Rx : ' || nbr_ || ' -- ' ||
'Val. Rx DCO/DBO5 : ' || cast(dco_dbo5 as decimal(15,2)) || ' -- ' ||
'Nat. : ' || effluent ;
SUSPEND;
END
LIGNE = '';
SUSPEND;
/******* Production de boue ***************/
LIGNE = 'PRODUCION DE BOUE';
SUSPEND;
FOR
SELECT nom_step,
avg(ratio_boue),
consigne_boue
FROM "[10]_PS_RATIO_BOUE"(:date_debut, :date_fin)
group by nom_step, consigne_boue
INTO :nom_step,
:ratio_boue,
:extration
DO BEGIN
LIGNE = 'STEP : ' || nom_Step || ' -- ' ||
'Fréq. Rx Boue : ' || nbr_ || ' -- ' ||
'Val. Rx Boue : ' || cast(ratio_boue as decimal(15,2)) || ' -- ' ||
'Extraction : ' || extration ;
SUSPEND;
END
END |