Do all the legs of an "OR" with null comparisons get executed?
- From: Arthernan <arthernan@xxxxxxxxxxx>
- Date: Fri, 28 Mar 2008 08:53:07 -0700 (PDT)
If I do an explain plan of the statement below I can see that the
"and" clauses that have MMDDOB=NULL do not get executed
select * from v_search where
UPP_FIRST='JOHN' and UPP_LAST='SMITH' and MMDDOB=NULL and AA=1 or
UPP_FIRST='JOHN' and UPP_LAST='SMITH' and BB=2 or
UPP_FIRST='JOHN' and UPP_LAST='SMITH' and CC='CA' or
UPP_FIRST='JOHN' and MMDDOB=NULL and AA=1 and BB=2 or
UPP_FIRST='JOHN' and MMDDOB=NULL and AA=1 and CC='CA' or
UPP_FIRST='JOHN' and BB=2 and CC='CA' or
UPP_LAST='SMITH' and MMDDOB=NULL and AA=1 and BB=2 or
UPP_LAST='SMITH' and MMDDOB=NULL and AA=1 and CC='CA' or
UPP_LAST='SMITH' and BB=2 and CC='CA' or
MMDDOB=NULL and AA=1 and BB=2 and CC='CA'
My problem is how to know if it does the same thing when I parametize
the query as
select * from v_search where
UPP_FIRST=:UPP_FIRST and UPP_LAST=:UPP_LAST and MMDDOB=:MMDD and
AA=:AA or
UPP_FIRST=:UPP_FIRST and UPP_LAST=:UPP_LAST and BB=:BB or
UPP_FIRST=:UPP_FIRST and UPP_LAST=:UPP_LAST and CC=:CC or
UPP_FIRST=:UPP_FIRST and MMDDOB=:MMDD and AA=:AA and BB=:BB or
UPP_FIRST=:UPP_FIRST and MMDDOB=:MMDD and AA=:AA and CC=:CC or
UPP_FIRST=:UPP_FIRST and BB=:BB and CC=:CC or
UPP_LAST=:UPP_LAST and MMDDOB=:MMDD and AA=:AA and BB=:BB or
UPP_LAST=:UPP_LAST and MMDDOB=:MMDD and AA=:AA and CC=:CC or
UPP_LAST=:UPP_LAST and BB=:BB and CC=:CC or
MMDDOB=:MMDD and AA=:AA and BB=:BB and CC=:CC
Any ideas?
.
- Follow-Ups:
- Re: Do all the legs of an "OR" with null comparisons get executed?
- From: fitzjarrell@xxxxxxx
- Re: Do all the legs of an "OR" with null comparisons get executed?
- Prev by Date: Re: recognize alpha's in varchar field of numeric characters
- Next by Date: Re: Oracle Cerificates
- Previous by thread: recognize alpha's in varchar field of numeric characters
- Next by thread: Re: Do all the legs of an "OR" with null comparisons get executed?
- Index(es):
Relevant Pages
|