/**************** Exemple ****************************/ /********* soit les deux procédure suivantes *********/ /************** Procédure première *******************/ CREATE PROCEDURE "[10]PS_INDICE_BOUE" ( date_debut date, date_fin date, step varchar(20), code_point_prlv smallint) returns ( nom_step varchar(20) character set unicode_fss, ouvrage varchar(30) character set unicode_fss, date_bilan date, ib integer, interpretation_ib varchar(300) character set unicode_fss) as BEGIN if ( (:date_debut is null) or (:date_fin is null) or (:code_point_prlv is null) or (:step is null) ) then begin exception Erreur_Champ_Vide; exit; end FOR select b.nom_step, a.designation, a.date_bilan, a.indice_boue, case when ( a.indice_boue < 50 ) then 'Mauvaise décantation des boues, les flocs ne sont pas assez concentrés ' when ( a.indice_boue between 80 and 100) then 'Les boues sont bien minéralisées et sédimentent facilement ' when ( a.indice_boue between 100 and 150) then 'Condition acceptables de décantation des boues' when ( a.indice_boue > 150) then 'Difficultés de décantation liées à un foisonement de bactéries filamenteuses "bulking"' else 'Hors gamme' end interpretation_IB from tb_indice_boue a inner join tb_step b on (b.code_step = a.code_step) where ( (a.date_bilan between :date_debut and :date_fin) and (b.nom_step) like upper(:step || '%') and (a.code_point_prlv) like (:code_point_prlv || '%') ) INTO :NOM_STEP, :OUVRAGE, :DATE_BILAN, :IB, :INTERPRETATION_IB DO BEGIN SUSPEND; END END /************** Procédure deuxième *******************/ CREATE PROCEDURE "[10]PS_RATIO_DCO_DBO5" ( date_debut date, date_fin date) returns ( nom_step varchar(20), effluent varchar(35), ratio_dco_dbo5 float) as BEGIN /* test sur la date */ IF (:date_debut > :date_fin) THEN EXCEPTION ERREUR_DATE; FOR a.nom_step, avg(b.dco_entree/b.dbo5_entree) ratio_dco_dbo5, case when (avg(b.dco_entree/b.dbo5_entree) between 1.5 and 2) then 'éffluent industrie agro-alimentaire' when (avg(b.dco_entree/b.dbo5_entree) between 2 and 3) then 'éffluent domestique' when (avg(b.dco_entree/b.dbo5_entree) > 3) then 'éffluent industriel' else 'hors gamme' end Effluent from tb_process b inner join tb_step a on (a.code_step = b.code_step) where (b.date_bilan between :date_debut and :date_fin) group by a.nom_step INTO :NOM_STEP, :Ratio_dco_dbo5, :Effluent DO BEGIN SUSPEND; END END /************ din des deux procédure **************/ /*que dois-je faire pour les exécuter tout les deux en même temps, */ /*sans avoir à les exécuter une par une mais dans un seul code source */ /******** merci *******************/