‎2007 Feb 09 11:50 AM
hi,
when iam doing extended error check in my program i am getting the error ' the WHERE condition for the key field 'NATION' does not test for equality. therefore a single record in question may not be unique' in the line SELECT SINGLE NAME_FIRST NAME_LAST FROM ADRPS statement.
‎2007 Feb 09 12:04 PM
Hello,
IN the select statement u need to specify all the keys fields when ur using select single
So when u r selecting from the table ADRPS use all the key fields
<b>TRKORR
PERSNUMBER
DATE_FROM
NATION</b> in the where condition.
If u don't have values fro all the key fields use UP to 1 rows instead of select single.
Vasanth
‎2007 Feb 09 11:53 AM
Hi,
You will get this Error when you are not specifying all the key fields in the where condition on the SELECT SINGLE...... query. To eliminate this, you will have specify all the key fields in the where condition or use SELECT UP TO 1 ROWS...... query.
btw there is no harm if you get this error also. this is jst like a warning saying that you might not be retrieving the exact record that you are intending to.
regards,
Mahesh
‎2007 Feb 09 11:58 AM
Hi Mahesh,
I got your point but how to specify all the keys in the where condition. Can you help me by providing an example.
Thanks,
Krishna.
‎2007 Feb 09 12:05 PM
suppose take table marc
here the primary keys are
key fields are
matnr
werks
so the code is
Select single .... from marc
where
matnr = p_matnr
and werks = p_werks .Means to say that i have covered all the keys .
In ur referred select see if u have covered all the keys .
<b>ur where clause has to have all teh below fieldsjust like above
where
TRKORR =
and PERSNUMBER =
and DATE_FROM
and NATION</b>
regards,
vijay
‎2007 Feb 09 12:04 PM
Hello,
IN the select statement u need to specify all the keys fields when ur using select single
So when u r selecting from the table ADRPS use all the key fields
<b>TRKORR
PERSNUMBER
DATE_FROM
NATION</b> in the where condition.
If u don't have values fro all the key fields use UP to 1 rows instead of select single.
Vasanth
‎2007 Feb 09 12:07 PM
Hi,
This error will come when you write the Select single statment, so make sure that you have mention all the key fields in the where condiiton, you need to see the database table key fields and give all the key field there in the where condition, if you do not have the fields, then look at the record whcih you want to select in the database(se11) and give that as default(Whihc fields you do not having in the program)..
or .
you can menation select upto 1 rows to eliminate this error
Regards
Sudheer
‎2007 Feb 09 12:13 PM
‎2007 Feb 09 12:31 PM
Hi Sudheer,
How to use this upto 1 row key word. Its throwing error when i tried that.
Thanks,
Krishna.
‎2007 Feb 09 12:37 PM
SELECT UP TO 1 ROWS FROM ZTABLE WHERE NATION EQ V_NATION.Message was edited by:
Chandrasekhar Jagarlamudi