User Tools

Site Tools


kurs:funktion_datum
FUNCTION CALC_BONUS
  ( salary IN number,
    hire_date IN date)
  RETURN number IS
  -- here the bonus var is defined
  bonus            employees.salary%TYPE;
  bonus_percentage employees.salary%TYPE;
BEGIN 
/* this function calclates the bonus 
   based on the input */
    
    bonus_percentage := get_p_number('bonus_percentage');
    bonus := salary * bonus_percentage;
    if hire_date < (sysdate - to_yminterval('10-0')) then
      bonus := bonus + 100000;     
    end if;
       
    RETURN bonus;
END;
kurs/funktion_datum.txt · Last modified: 2014/09/10 21:22 (external edit)