Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Extended error check.

Former Member
0 Likes
967

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
929

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

8 REPLIES 8
Read only

Former Member
0 Likes
929

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

Read only

0 Likes
929

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.

Read only

0 Likes
929

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

Read only

Former Member
0 Likes
930

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

Read only

Former Member
0 Likes
929

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

Read only

0 Likes
929

select upto 1 rows it should solve u r problem..

Read only

0 Likes
929

Hi Sudheer,

How to use this upto 1 row key word. Its throwing error when i tried that.

Thanks,

Krishna.

Read only

0 Likes
929
SELECT UP TO 1 ROWS FROM ZTABLE WHERE NATION EQ V_NATION.

Message was edited by:

Chandrasekhar Jagarlamudi