In response to a MATCH command, the data adapter selects the first row in the table that meets the MATCH criteria. The MATCH command compares incoming data with one or more field values and then performs actions that depend on whether or not a row with matching field values exists in the table. |
In this section: How to: Use the MATCH Command in MODIFY Example: Using the MODIFY MATCH Command Reference: |
The syntax of the MATCH command in MODIFY is
MATCH field1 [field2...fieldn]
ON MATCH action_1
ON NOMATCH action_2
where:
Your FOCUS documentation on maintaining databases discusses these actions in detail.
MATCH processing for multi-table Master Files is the same as for a multi-segment FOCUS data source.
In Maintain, you do not have to include an ON NOMATCH command in order to reject a transaction; Maintain automatically rejects a transaction that does not satisfy the MATCH criteria. See your FOCUS documentation on maintaining databases for MATCH syntax in Maintain.
Acceptable actions for MATCH commands fall into eight groups. They are operations that:
In MODIFY requests, there are two major differences in the way MATCH commands function for the data adapter and for native FOCUS:
For example, if the primary key is EMP_ID and the incoming value for MATCH LAST_NAME is SMITH, the answer set contains all rows with last name SMITH.
Note: In Maintain, MATCH functions identically for the data adapter and for native FOCUS.
Consider a MODIFY request that maintains the EMPINFO table. It prompts for an employee ID and for a new salary; then it processes the incoming data. The annotated request contains the following MATCH commands:
MODIFY FILE EMPINFO
PROMPT EMP_ID CURRENT_SALARY
1. MATCH EMP_ID
2. ON MATCH UPDATE CURRENT_SALARY
3. ON NOMATCH REJECT
DATA
The incoming transaction contains the following values:
EMP_ID = 123456789
CURRENT_SALARY = 20000
The request processes as follows:
Information Builders |