Please, add this style
SQL:
select m.ENAME
into result
from EMP e,
EMP m
where e.EMPNO = P_EMPNO
and m.EMPNO = e.MGR
and d.DEPTNO in (10, 20, 30, 40);
where aliases in lowercase, but field name and parameters in uppercase.
And add in CASE-WHEN-THEN-END section AND/OR under where clause, both for WHERE-section.