Application Development 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: 

Native SQL didn't return the correct data

Former Member
0 Kudos

Hi all,

I have got an issue when using native SQL.

I want to do case-insensitive fetching, so I am using native SQL.

In DB table, the data is like:

col1 col2

001

002

col1 is key and col2 has intial value.

In coding:

lv_abc = 'ABC'.

select col1 from table into :gs_xxx where (upper)col2 = :lv_abc.


Normally, you should have got no data.

But the odd thing is, I did get these 2 entries.


I have tried open SQL as well and I get nothing which is correct.

So I am wondering why native SQL would return the wrong data set.

2 REPLIES 2

raymond_giuseppi
Active Contributor
0 Kudos

I suppose those are not "initial" values (space, zeroes) but "null" values, so fulfill any check, try to add a criteria IS NOT NULL.

Regards,

Raymond

0 Kudos

col2 is initial value. I have also tried SE11, and enter 'ABC' as search criteria and get nothing.

So why the data can be fetched if the where clause is col2 = 'ABC' in native SQL.

It's really strange.