Using for loop for moving thru rows in a table

reenageorge5

New Member
How can i use for loop to read from a table starting with a particular row.For example, i have a employee details table which contains empno column.iwant to read only some rows from table. for that im providing starting empno and ending empno.
EMPNO From :--EMx------- EMPNO To :----EMA----- when i fill these ,the for loop should fetch raws in tables. not importance for the entered values.imp for the order of raws in the table.:confused::confused::confused:
 
Code:
define variable start_empno as integer no-undo.
define variable end_empno as integer no-undo.

update start_empno end_empno.

for each employee no-lock
    where empno >= start_empno and empno <= end_empno:

  /* do something with the employee record */

end.
 
Back
Top