Modifying Data
With the MODIFY and Maintain facilities, you can add new rows to a table, update column
values for specific rows, or delete specific rows.
The data adapter processes a MODIFY or Maintain transaction with the following steps:
- FOCUS reads the transaction for incoming data values.
- The data adapter generates the appropriate SQL SELECT statement.
- The RDBMS either returns an answer set consisting of one or more rows that satisfy the SELECT request, or determines that the row does not exist.
- After the RDBMS returns the answer set and/or return code, the data adapter either:
- Performs the update operation (UPDATE or DELETE) on the returned answer set. With MODIFY, the data adapter processes one row at a time; with Maintain, it can either process one row at a time or a set of rows.
- Creates the new row (INCLUDE). In Maintain, it may create multiple rows.
- The RDBMS changes the data source appropriately.
In MODIFY, you must use the NEXT command to process a multi-row answer set one row at
a time. Each NEXT command puts you physically at the next logical row in the answer set. In
Maintain, one NEXT command can process a multi-row answer set without a prior MATCH.