Re: Do all the legs of an "OR" with null comparisons get executed?




"Arthernan" <arthernan@xxxxxxxxxxx> schreef in bericht
news:e65e3d5b-d8be-4dec-a1fa-8c17a1e89bf2@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Mar 28, 11:41 am, "fitzjarr...@xxxxxxx" <fitzjarr...@xxxxxxx>
wrote:
That is an alternative. I do think the logic is correct thought. Take
the first comparison for example:

UPP_FIRST='JOHN' and UPP_LAST='SMITH' and MMDDOB=NULL and AA=1


I do not want to get any rows back if MMDDOB was NULL. In this case I

In that case you should use

WHERE MMDDOB is not NULL and (--- rest of your conditions).

MMDDOB = NULL is ALWAYS false (or actually undefined but not true) so these
clauses dont need to be calculated. You could replace the whole part with
"0=1"


want Oracle to skip that comparison at execution. And it does do that
when it is not parametized. I just don't know if it will when I
parametize it.

The code is very simple and straight forward as it is. And I do
believe it is also correct.

No it's not, comparing with '=NULL' id definitely wrong.

I don't want to make it complicated if it
not necessary.

But you already did.

Arturo Hernandez

Shakespeare


.



Relevant Pages