PL/SQL Best Practices [13][If Statements]-Boolean Elements
You can code real Boolean variables and literals (TRUE, FALSE and NULL values) in PL/SQL.
Boolean variables and functions allow you to greatly improve readability of programs. You can hide complex expressions behind a name, which describes the expression.
Compare the two IF statements below.
IF total_sal BETWEEN 10000 AND 50000 AND
emp_status (emp_rec.empno) = 'N' AND
(MONTHS_BETWEEN
(emp_rec.hiredate, SYSDATE) > 10)
THEN
give_raise (emp_rec.empno);
END IF;The second IF statement:
IF eligible_for_raise (emp_rec.empno)
THEN
give_raise (emp_rec.empno);
END IF;

浙公网安备 33010602011771号