View previous topic :: View next topic
|
Author |
Message |
natinuk
New User
Joined: 23 Nov 2006 Posts: 22 Location: India
|
|
|
|
Hi, I have a COBOL program using the below SQL ,
SELECT EMP_NAME,EMP_LOC
FROM COMP_DET
WHERE (EMP_ID = :T00-EMP-ID
OR 0<>0)
Can you please help me out what is the purpose of '0<>0' condition in the WHERE clause.
FYI: Data type for EMP_ID is Integer.
Thanks in Advance. |
|
Back to top |
|
|
yogalakshmi
New User
Joined: 20 Sep 2007 Posts: 17 Location: cheenai
|
|
|
|
If there is any index (say A) on EMP_ID, providing constraints like 0<>0,0=1 will force the optimizer not to choose that index(A) for the indexed access. In this case, as there is only one predicate that too on EMP_ID providing 0<>0 would lead to table space scan even though the indexed access is possible (by A). |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
Back to top |
|
|
|