FORALL

The data retrieval statement FORALL must be used to make use of the fields or sub-entries of a plural entry to the database. When you browse a DID in the list of entries you will find which entries you can use and which of them are plural.

Definition statement FORALL:

FORALL <Entry_reference_name> IN <Database entry reference. See below>
DO
ITP-model part with declarations
OD

The database (sub)entry reference in case of main entries has the following structure:

<DID_three_letter_code>.<DID_defined_Main_Entry> 

or in case of sub entries:

<Entry_reference_name>.<DID-defined_Sub_Entry> 

The Entry_reference_name is the name a model developer must give to the entry. It has to start with an uppercase character followed by uppercase or lowercase characters, numbers and/or underscores ( _ ).

This Entry_reference_name can be used within the DO...OD part of the model to approach fields or sub-entries from the entry.

The DO-OD part will be executed zero or one time depending on whether the requested data is present in the database and more times if the data is present more than once. In other words a FORALL data retrieval statement will cycle through all data in the selected entry or sub-entry.

Examples taken from the examples installed with ITP/Workstation

Main entry field value retrieval. This will result in a list of customers.

#BEGIN
FORALL Cust IN EXP.Customer
DO
#
Customer: @(Cust.Surname)
#
OD

END#

Nesting of a singular entry access within a plural entry access.

#BEGIN
FORALL Cust IN EXP.Customer
DO
#
Customer: @(Cust.Initials) @(Cust.Surname)
#
WITH Part IN Cust.Partner
DO
#
Partner: @(Part.Initials) @(Part.Surname)
#
OD
OD
END#

Note that in this example every customer has one partner at the most.