create or replace function CALC_AGE (i_SSN in varchar2) return NUMBER
is
birthdate date;
ret_age number;
begin
select BDATE into birthdate from employee where ssn = i_SSN;
select round((sysdate - birthdate)/365) into ret_age from dual;
return ret_age;
end CALC_AGE;




Reply With Quote