ProLinga-4GL Reference Manual |
---|
FOREACH — Return data rows of a returned datamodel.
FOREACH
data_model_name
The FOREACH command returns all rows from a data model. Entries in the data model can be referenced as:
M-_col_no.datamodel_name
M-external_field_name.datamodel_name
M-alias.datamodel_name
Columns which have no obvious name (result of calculation for instance), can only be referenced by the column number. Alternatively, the complete data model can be copied to a Record or VariableGroup in a single assignment statement.
. . . . . . CLEAR DATAMODEL dm_customer SQL QUERY Order COMMAND "select * from " T-Cust DATAMODEL dm_customer FOREACH dm_customer CALL PrintLabel M-_col_1.dm_customer M-cust_name.dm_customer ENDFOR . . . . . . CLEAR DATAMODEL dm_customer DATAMODEL SELECT dm_customer TABLE Cust FOREACH dm_customer LET R-Customer = O-dm_customer CALL PrintLabel F-Cust_Id.Customer F-Name.Customer ENDFOR . . . . . .
<< FOR Command | FOREVER Command >> |