erreur execution fonction
Bonjour à Tous, J'ai 1 petit soucis avec une requête qui doit me ramener le nomfou, satisf et CA, puis ensuite executer la fonction FN_SATISFATION qui me ramène le commentaire en fonction des indices de satisfaction par rapport au CA réalisé.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
create or replace function FN_SATISFACTION (indice int) return varchar2 as
begin
RETURN
case
when indice is null then 'Sans commentaires'
when indice between 1 and 2 then 'Mauvais'
when indice between 3 and 4 then 'Passable'
when indice between 5 and 6 then 'Moyen'
when indice between 7 and 8 then 'Bon'
when indice >= 9 then 'Excellent'
end ;
end FN_SATISFACTION ; |
la fonction fonctionne très bien.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
select bob.nomfou, bob.CA, FN_SATISFACTION(fou.satisf)
from
((select toto.*, sum(round((lig.qtecde * lig.priuni*1.206),2)) as CA
from ligcom lig, entcom ent, fournis fou
where ent.numcom= lig.numcom
and ent.numfou=fou.numfou)
from (select fou.nomfou, fou.satisf from fournis fou)toto;)bob)
group by bob.nomfou ; |