WITH

The data retrieval statement WITH must be used to retrieve fields or sub-entry values of a singular 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 singular.

Definition of the statement WITH:

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

The database entry reference has the following structure:

<DID_three_letter_code>.<DID_defined_Main_Entry> ( in case of a main entry )

Or

<Entry_reference_name>.<DID_defined_Sub_Entry> ( in case of a sub entry )

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

This name can be used to approach fields or sub-entries from the entry.

Note

The DO-OD part will be executed exactly one time if the requested data is present in the database. If the data is not present the DO-OD part is not executed at all.

Examples taken from the examples installed with ITP/Workstation.

Main entry field value retrieval:

#BEGIN
WITH Cust IN EXP.Customer
DO
#
Dear Mr. @(Cust.Surname)
#
OD
END#

Access of a sub-entry and field value retrieval:

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