TP4.sql
CREATE OR REPLACE PROCEDURE Augmentation_salaire
AS
cursor cr is select *
        from EMPLOYE
        where CATEGORIEEMPLOYE='MECANICIEN'
        or    CATEGORIEEMPLOYE='ASSISTANT' ;
    c cr%rowtype;
    s EMPLOYE.SALAIREPLOYE%type ;
    vide EXCEPTION;
begin
    for c in cr loop
        if(c.CATEGORIEEMPLOYE ='MECANICIEN')
            then s:=c.SALAIREPLOYE*1.5 ;
        else
                 s:=c.SALAIREPLOYE*1.3;
        end if;
DBMS_OUTPUT.PUT_LINE
  ('le nouveau salaire de l employe : '||c.NOMEMPLOYE||' ' ||
   'qu est un '||c.CATEGORIEEMPLOYE||' est :'|| s);
        update EMPLOYE e set SALAIREPLOYE = s
        where e.NUMEMPLOYE= c.NUMEMPLOYE;
    end loop;
    EXCEPTION when vide then
       dbms_output.put_line('Aucun employe trouvé');
end;  
/  
execute Augmentation_salaire ;