‎2005 Dec 22 9:40 AM
Hi all,
What do this select statement:
SELECT * UP TO 1 ROWS FROM LIPS WHERE ZZOBJNR = VA_L_OBJNR.
I have never seen "select * up to 1 rows".
Thanks all.
‎2005 Dec 22 9:43 AM
It will fetch only the first record from table even if more than one records match your selection criteria.
The action is similar to SELECT SINGLE *
Message was edited by: Sudhir Bhate
‎2005 Dec 22 9:43 AM
It will fetch only the first record from table even if more than one records match your selection criteria.
The action is similar to SELECT SINGLE *
Message was edited by: Sudhir Bhate
‎2005 Dec 22 9:46 AM
Fabrizio,
This will SELECT only one row from the database even if the where clause is satisfied by multiple rows.
I would rather suggest you to use SELECT single, which gives a better performance.
Regards,
Ravi
Note : Please reward the posts that help you.
‎2005 Dec 22 9:46 AM
what ever the record that satisifies the where condition it will fetch, and even if you have more records with that condition it will fetch the first record that satisfies the condition.
vijay
‎2005 Dec 22 9:47 AM
Hi
It's way to say to system to get out the first record is found.
You can also write this statament in this way:
SELECT * FROM LIPS WHERE ZZOBJNR = VA_L_OBJNR.
EXIT.
ENDSELECT.
Or
SELECT SINGLE * FROM LIPS WHERE ZZOBJNR = VA_L_OBJNR.
But this last statament is not really correct, because ZZOBJNR is not the key of LIPS.
Max
‎2005 Dec 22 9:47 AM
‎2005 Dec 22 9:51 AM
Hai Ballante,
Here is the explanation.
... UP TO n ROWS
Effect
This addition restricts the number of rows in the result set. A data object of the Type i is expected for n. A positive number in n indicates the maximum number of rows in the result set. If n contains the value 0, all selected rows are passed to the result set. If n contains a negative number, an exception that cannot be handled is raised.
If the addition ORDER BY is also specified, the rows of the hit list are sorted on the database server and only the number of sorted rows specified in n are passed to the result set. If the addition ORDER BY is not specified, n is filled with any number of rows in the result set that meet the WHERE condition.
with regards,
Manikandan R