PL/SQL Best Practices [11][If Statements]-Nested IF use
Generally, you will want to use an ELSIF statement instead of nested IFs.
A good candidate for a nested IF, however, arises when one condition is much more resource-intensive than the other. Suppose condition A consumes .05 CPU seconds and condition B consumes 10 minutes. You don’t want to execute B unless A is TRUE -- and you don’t want to rely on the compiler to decide which clause is evaluated first.
IF condition A
THEN
IF condition B
THEN

END IF;
END IF;
浙公网安备 33010602011771号