View previous topic :: View next topic
|
Author |
Message |
deva
New User
Joined: 03 Nov 2005 Posts: 19
|
|
|
|
Hi,
I have different situation..
SELECT * FROM TABLE EMP
WHERE A = '10' AND
B = '20' AND
C = '30'
Table values for A,B,C are 10, 20, 40.
So obviously my query will return '100', here I know that third condition fails because '30' not matching with table C value '40' and rest the two are TRUE. Is there any thing know about this from query it self, means in WHERE because of which condition we received '+100'.
Deva.. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
deva wrote: |
Hi,
I have different situation..
SELECT * FROM TABLE EMP
WHERE A = '10' AND
B = '20' AND
C = '30'
Table values for A,B,C are 10, 20, 40.
So obviously my query will return '100', here I know that third condition fails because '30' not matching with table C value '40' and rest the two are TRUE. Is there any thing know about this from query it self, means in WHERE because of which condition we received '+100'.
Deva.. |
No there is nothing that will tell which condition caused the not found, it would be possible (maybe not in you case) for multiple conditions to cause a not found. |
|
Back to top |
|
|
deva
New User
Joined: 03 Nov 2005 Posts: 19
|
|
|
|
Is it possible to get for at least one condition , means is because of A='10' or not, no need to know about other two conditions but those two should be in query. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Use OR instead of AND and you will know that at least one of the conditions is true....Then check for yourself to see if all are true and/or which are false..... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Keep in mind that if multiple rows might be returned to your program, you will want to use a cursor. If a simple select returns multiple rows to your program, you will get a -811 return code from db2. |
|
Back to top |
|
|
|