i have a problem in my procedure...in this case i want to raisy the salary to employees(Empleado) that have been working 5 years or more inn the store "Bodega"(...sorry about my english,i speak spanish XD). First, i was thinking about select the ID's of all the employees that satisfy the condition (in a cursor) and then compare them to the ID'S in the EMPLEADO TABLE, if the same(the ID'S) then UPDATE the salary...it doesn't work with the IF - END IF (i put in COMMENTS) but without it. needing help...i am doing something wrong but dont know what it is.
CREATE OR REPLACE PROCEDURE aumento_empleado(idBodega IN CHAR)IS
CURSOR c_empl IS SELECT E.idEmpleado 
             FROM Empleado E, Bodega B
             WHERE( MONTHS_BETWEEN(sysdate,E.fecha_contrato)>=5*12 
                    AND E.id_Bodega=B.id_Bodega 
                    AND B.id_Bodega=idBodega); 
idEmpl Char(8);
NO_EMP EXCEPTION;
 BEGIN
 OPEN c_empl;   
LOOP    
FETCH c_empl INTO idEmpl;
EXIT WHEN c_empl%notfound;
  IF c_empl%ROWCOUNT=0 THEN
      RAISE NO_EMP;
  END IF;   
--IF (idEmpl=Empleado.idEmpleado) THEN  
  UPDATE Empleado
  SET Empleado.Sueldo=Empleado.Sueldo + Empleado.Sueldo*0.05;   
--END IF;
END LOOP;   
CLOSE c_empl;
EXCEPTION
   WHEN NO_EMP THEN
         dbms_output.put_line('No hay empleados que cumplan con las condiciones pedidas para la bonificacion' ) ;
   WHEN OTHERS THEN 
     dbms_output.put_line('Error: hubo un error durante la ejecucion del procedimiento' ) ;
END aumento_empleado;

UPDATE Empleado SET Empleado.Sueldo=Empleado.Sueldo + Empleado.Sueldo*0.05 WHERE EMPLEADO.idEMPLEADO=idEmpl. And please don't apologize - your English is a lot better than my Spanish. :-) Share and enjoy.