FOR/LOOP
TheFOR/LOOP
construct is used to execute iterative DGL statements. This statement executes the statements betweenLOOP
andEND
LOOP
for each item in the specified list. The identifier is a variable whose value is set sequentially to the items in the list. This variable can be used within the body of the loop, but its value cannot be reassigned.Alternatively, a range of integers can be specified in place of thelist
, as in the following example:FOR i IN {1..100} LOOP
statement;
.
.
.
END LOOP;
A variable whose value is set sequentially to the items in the list. The type of theidentifier
must match the type of thelist
. This variable can be used within the body of the loop. The type of the variable identifier must match the type of the list. The list can be a range of integers written as follows, where x is an integer variable:FOR id IN statelist LOOP
WRITE (’\n’, stm_r_st_name (id, status));
END LOOP;
●
●