Simple Oracle Function which Returns Yes or No

CREATE OR REPLACE FUNCTION isStudentInArmy(p_location  IN VARCHAR(255),
                                           p_age       IN LONG)
RETURN CHAR
IS
   isArmyMen CHAR(1);
BEGIN
  SELECT CASE 
          WHEN  BodyType == 'Well Built and Strong' THEN  'Y'
          ELSE 'N'
       END INTO isArmyMen
  FROM tblMens 
 WHERE Location = p_location AND
       Age      = p_age;

  RETURN isArmyMen;
END isStudentInArmy;

Comments are closed.