Re: Operator and condition precedence

  • From: Michael Moore <michaeljmoore@xxxxxxxxx>
  • To: Oracle L <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 9 Sep 2009 09:38:40 -0700

Hi,
Just read the doc that your link points to. That documentation *does* seem
to contradict my observations. For example:

select * from dual where
1/0 = 1 and 'x' = 'y';

Results in "No rows returned."

Obviously the 'x' = 'y' is evaluating to FALSE and "1/0 = 1" is never
evaluated.

reversing the predicates like this:
select * from dual where 'x' = 'y' and 1/0 = 1;

results in "ORA-01476: divisor is equal to zero"

Obviously, at least my case, the predicates are being evaluated in REVERSE
order.

This seems to be in direct contradiction to the documentation which states:

"Predicates without any user-defined functions, type methods, or subqueries
are evaluated first, in the order specified in the WHERE clause." - *Oracle®
Data Cartridge Developer's Guide
10g Release 1 (10.1)*
Part Number B10800-01

Mike

>
>

Other related posts: