I am trying check whether or not a department number I am passing from the calling environment is valid. The return value must be boolean. Something is wrong with this program here. Can anyone explaine it to me? Thanks!!

CREATE OR REPLACE FUNCTION valid_deptno
(v_deptno DEPT.DEPTNO%TYPE)
RETURN BOOLEAN
IS

v_valid DEPT.DEPTNO%TYPE;

BEGIN

SELECT deptno
INTO v_valid
FROM dept
WHERE deptno = v_deptno;

IF SQL%NOTFOUND THEN
RETURN FALSE;
ELSIF SQL%FOUND THEN
RETURN TRUE;
END IF;

END;
/