I have a function that returns the age of a person or ‘Deceased’ if they have died. Because it returns either a number or Deceased the RETURN is a VARCHAR2.
When an age is returned it returns a value like: 72.93541936015413085912743681395289882628. Is there anyway to alter the value within the variable to only return the charaters before the decimal point?
Thanks
cast it as a number:
will round it down
will round it up
will round it
and if you had to send it back to as a string, cast it back
but you might need to check for the value ‘deceased’ , so use a case: