‎2007 Jun 23 5:55 PM
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
‎2007 Jun 23 10:10 PM
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
‎2007 Jun 23 5:57 PM
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
‎2007 Jun 23 10:10 PM
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
‎2007 Jun 24 12:45 AM
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