If a ProDataSet contains changes to be applied to a data-source, but no BEFORE-TABLE records exist for it and therefore no ROW-STATE, you may still want to use the SAVE-ROW-CHANGES( ) method to move the new data from the ProDataSet to the source database. However, this is problematic, since SAVE-ROW-CHANGES( ) requires a before-table record with a ROW-STATE for each record to be saved. This method creates the before-table records needed by SAVE-ROW-CHANGES( ).
An integer expression evaluating to one of the row-state values or one of the compiler constants ROW-CREATED, ROW-MODIFIED or ROW-DELETED shown in the following table.
Table 90. Row state values
Compiler constant
Value
Description
ROW-UNMODIFIED
0
The row was not modified.
ROW-DELETED
1
The row was deleted.
ROW-MODIFIED
2
The row was modified.
ROW-CREATED
3
The row was created.
before-image-source-buffer-handle
An optional handle to the before-image source buffer.
If row-state is ROW-UNMODIFIED, or if there is already a before-table record, no action is taken.
If row-state is ROW-CREATED, a before-table record is created and its ROW-STATE is marked as ROW-CREATED. The before-table record is associated with the buffer object handle record.
If row-state is ROW-MODIFIED and the second optional parameter is defined, a before-image record is created by copying the before-image source buffer. If the second parameter is not defined, then a data-source must be attached to the buffer object handle. In this case the data-source mapping is used to locate the data-source record(s) related to the buffer object handle, which is used to create a before-table record. The before-table record is marked ROW-MODIFIED and is associated with the buffer object handle record.
Note: If the second parameter is not defined and if the data-source top level record cannot be located, then a ROW-CREATED before-table record will be created and associated with the buffer object handle record.
If row-state is ROW-DELETED and the second optional parameter is defined, a before-image record is created by copying the before-image source buffer. If the second parameter is not defined, then a data-source must be attached to buffer object handle. In this case the data-source mapping is used to locate the data-source record(s) related to buffer object handle, which then can be used to create a before-table record.
If a second parameter is not defined, then the buffer object handle must contain a temporary record whose only purpose is to locate the data-source. Otherwise it can be empty.
Note that if buffer object handle is for a static table that was defined without a BEFORE-TABLE option, MARK-ROW-STATE( ) causes the AVM to raise ERROR. If buffer object handle is for a dynamic table that has no before-table, one is automatically created.