PLSQL
Script for Function
create or replace function dob (birth char) return char as
x date;
age varchar2(30);
begin
select
to_date(birth,'ddmmyyyy') into x from dual;
select
trunc(months_between(sysdate, x)/12) ||' Years '||
trunc(mod(months_between(sysdate, x),12)) ||' Months '||
trunc(sysdate-add_months(x, trunc(months_between(sysdate, x)/12)*12+trunc(mod(months_between(sysdate,x),12))))||
' Days ' into age
from dual;
return age;
exception