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

select single help

Former Member
0 Likes
386

hallow

i use in my program a select single statment but i heard that it bed for performance

but every time i work with one row like select person ,name ,id,pernr..and contnue with data of person

which metod i have to use for better performance

Regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
365

Hi

Its not true that select single is bad for performance. Select Single is used to fetch distinct record from db table which is possible only by giving all key fields.

Select single without all key fields will not fetch the distinct 1 record but any one of the records which satisfy the conditions.

There is no difference in the performance between the 2 statements. Just that you will get a EPC warning when you give select single without all key fields.

Regards

Navneet

3 REPLIES 3
Read only

Former Member
0 Likes
365

Hi,

Generally if you have the full primary key you should use SELECT SINGLE..

Otherwise to get one row..you can use SELECT UP TO 1 ROWS..ENDSELECT with the WHERE CLAUSE.

Thanks

Naren

Read only

Former Member
0 Likes
366

Hi

Its not true that select single is bad for performance. Select Single is used to fetch distinct record from db table which is possible only by giving all key fields.

Select single without all key fields will not fetch the distinct 1 record but any one of the records which satisfy the conditions.

There is no difference in the performance between the 2 statements. Just that you will get a EPC warning when you give select single without all key fields.

Regards

Navneet

Read only

Former Member
0 Likes
365

use select single - When ever you have primary key

use select upto 1 row - if you do not have proper primary key condition in where caluse for select single then go for select upto 1 row.

And also Better to write the code outside of the loop by using for all entries condition ,then use read table within table -> which gives better performance.

Thanks

Seshu