Data retrieval

Data retrieval is achieved using Entries, abstractions of the database which are defined in the DID. In the following example, the entry Customer will retrieve data from the database. ITP groups the retrieved fields in a 'record' which you can refer to as Cust. This record is available between the ITP statements DO and OD. The fields that are contained in the record have been defined in the entry definition in the DID. Since the method to actually retrieve the data has also been defined in the DID, no more specifications are needed in the model document.

...
WITH Cust IN EXP.Customer DO
#
Dear Ms. or Mr. @(Cust.Surname),
In reference to your writing...
#
OD
...

The construct WITH will retrieve one record from the database. If ITP should retrieve multiple records, you can use the construct FORALL. The part DO ... OD of the FORALL construct will be executed for each record that has been retrieved. Again, the method to retrieve the data has been defined in the DID.

...
WITH Cust IN EXP.Customer DO
#
Dear Ms. or Mr. @(Cust.Surname),
In reference to your writing....
A list of the ordered articles follows:
#
FORALL Art IN Cust.Ordered_articles DO
#
@(Art.Number_of_articles) @(Art.Article_description)
#
OD (* FORALL Art IN Cust.Ordered_articles *)
OD (* WITH Cust IN EXP.Customer *)
...

The relation between Customer and Ordered_articles has been defined in the DID. Therefore, the developer of model documents only need to know that these relations exist, not how they are implemented.