Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> PL/SQL Beginner Question ...
Hello,
I'm just reviewing some pl/sql code that I've been given and I was wondering if someone could educate me regarding how a pl/sql IF statement is evaluated, does it short circuit the evaluation once one truth is determined or does it evaluate the entire expression? Does it evaluate left to right or right to left?
Also, are these two blocks contextually the same? Which uses better style?
Firstly consider there are functions titled functionX where X is a number from 1 to 4, each function will return a boolean value.
IF NOT function1
THEN IF NOT function2
THEN IF NOT function3 THEN IF NOT function4 THEN statement; END IF; END IF: END IF;
IF function1 THEN
statement;
ELSEIF function2 THEN
statement;
ELSEIF function3 THEN
statement;
ELSEIF function4 THEN
statement;
ELSE
statement;
END IF;
Thanks,
cdecarlo Received on Thu Apr 05 2007 - 13:29:29 CDT