‎2007 Jul 26 6:56 AM
1) SELECT * FROM SBOOK INTO SBOOK_WA
UP TO 1 ROWS
WHERE CARRID = 'LH'.
ENDSELECT.
2) SELECT * FROM SBOOK INTO SBOOK_WA
WHERE CARRID = 'LH'.
EXIT.
ENDSELECT.
how above queries will execute.?
‎2007 Jul 26 7:02 AM
1) will select one row of first record.
2)same as above,will select one record and exit
Regards,
Reema
‎2007 Jul 26 7:02 AM
1) will select one row of first record.
2)same as above,will select one record and exit
Regards,
Reema
‎2007 Jul 26 7:07 AM
‎2007 Jul 26 7:08 AM
Hi,
Both will have the same effect. Only difference is in the second case there is one more statement 'EXIT' for the program to excute, where as in the first case its not the case.
Check with this program.
DATA: SBOOk_WA TYPE SBOOK.
SELECT * FROM SBOOK INTO SBOOK_WA
UP TO 1 ROWS
WHERE CARRID = 'LH'.
ENDSELECT.
write: sbook_wa-carrid.
clear: sbook_wa.
SELECT * FROM SBOOK INTO SBOOK_WA
WHERE CARRID = 'LH'.
EXIT.
ENDSELECT.
write: sbook_wa-carrid.
Regards,
Sesh
‎2007 Jul 26 7:17 AM
when the database is queried in both case.
1)the performance is better as it queries for one record by explicitly saying upto one row
2)It queries randomly and exits the loop.
‎2007 Jul 26 7:07 AM
Hi,
Both will have the same effect.<b> Only difference is in the second case there is one more statement 'EXIT' for the program to excute, where as in the first case its not the case.</b>
Check with this program.
DATA: SBOOk_WA TYPE SBOOK.
SELECT * FROM SBOOK INTO SBOOK_WA
UP TO 1 ROWS
WHERE CARRID = 'LH'.
ENDSELECT.
write: sbook_wa-carrid.
clear: sbook_wa.
SELECT * FROM SBOOK INTO SBOOK_WA
WHERE CARRID = 'LH'.
EXIT.
ENDSELECT.
write: sbook_wa-carrid.
Regards,
Sesh
‎2007 Jul 26 1:17 PM
1) SELECT * FROM SBOOK INTO SBOOK_WA
UP TO 1 ROWS
WHERE CARRID = 'LH'.
ENDSELECT
ex
loop at SBOOK INTO SBOOK_WA WHERE CARRID = 'LH'. .
write: SBOOK_WA-CARRID
endloop.
above exp condition ok write carried.