What is the diffrence between select single * and Select
upto 1 row?

Answer Posted / ad

The SELECT SINGLE statement selects the first record in the
database table depending on the condition mentioned in the
WHERE clause. Only the first record is returned and may not
be unique. ENDSELECT keyword is not needed here.

But for the case of SELECT UPTO 1 ROW, all relevant records
are being selected depending on the WHERE clause. Then any
aggregate or grouping or ordering condition is applied to
them and only the 1st record from the resultant set is
being returned. ENDSELECT is must here.

SELECT SINGLE should be used for selecting with full
primary key combination but SELECT UP TO 1 ROWS is the
special case of SELECT UP TO n ROWS and can be used with
any WHERE condition.

As regarding the speed or performance it depends on various
conditions. If your database table contains several
entries, then SELECT UPTO 1 ROWS might take a longer time
to fetch and order all relevant records. But for limited
entries check for full primary key combination takes more
time in case of SELECT SINGLE. If you donot provide all
primary keys in SELECT SINGLE you will get message during
extended syntax check (SLIN).

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is payroll driver ? : abap hr

612


Why grouping of fields is required? What is the max no of modification groups for each field?

562


What is web dynpro for abap?

577


What are the restrictions on subscreens?

650


How to debug rfc function module?

705






What are the screen painter and menu painter?

582


Can we make use of flow logic control key words in abap/4 and vice-versa?

599


What happens if a function module runs in an update task?

562


How collect statement is different from append?

539


What are the requirements a dialog program must fulfill?

639


Does the bdc-insert function allow multiple transactions to be processed by sap? : abap bdc

674


How do you document abap/4 programs? Do you use program documentation menu option?

702


What is the different between abap and ooabap? Why do we use ooabap?

637


What is the reserve command?

670


What are the list of screen elements?

532