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

execute

Former Member
0 Likes
669

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.?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
649

1) will select one row of first record.

2)same as above,will select one record and exit

Regards,

Reema

6 REPLIES 6
Read only

Former Member
0 Likes
650

1) will select one row of first record.

2)same as above,will select one record and exit

Regards,

Reema

Read only

0 Likes
649

i wanna know how execution takes place?

Read only

0 Likes
649

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

Read only

0 Likes
649

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.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
649

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

Read only

Former Member
0 Likes
649

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.