ForEach statement for a relational database

The forEach statement defines a loop that retrieves each row in an SQL result set and operates on the most recently retrieved row by running a block of embedded EGL statements. After processing all rows, the forEach statement closes the result set. If an exception occurs, the result set stays open.

Syntax



Syntax diagram for the forEach statement with SQL

entity
Name of the entity, which is a variable based on an External type, Handler type, or Record type.
simpleVar
A field of an EGL simple type that is compatible with the corresponding column in the result set.
SQLResultSet
An SQL result set that was established by an open statement.
statement
An EGL statement.

Compatibility

Table 1. Compatibility
Target Issue
Java No issues
JavaScript Database access is not supported in JavaScript.