Create or define the before-tables
- Last Updated: February 11, 2026
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
Syntax
For a dynamic temp-table, a before-table is
created only when the temp-table's TRACKING-CHANGES attribute
(or the corresponding ProDataSet attribute) is first set to true.
After that the before-table remains in existence for the life of
the after-table, even as TRACKING-CHANGES is set
to false and back to true.
When you pass a ProDataSet parameter,
if the receiving procedure receives the ProDataSet as a dynamic
object (as a DATASET-HANDLE), then the AVM automatically
creates a before-table for each modified temp-table if one does
not already exist.
In the case of a static temp-table that
might be used to track changes as part of a ProDataSet, you must
provide a static name for its before-table by naming it in the DEFINE
TEMP-TABLE statement, as shown in the following syntax:
|
The AVM cannot create a before-table for you at run time as it does for dynamic tables. Procedure code can refer to the before-table by name as it does other temp-tables, except that any attempt to directly modify its records results in a run-time error. For a static definition, the before-table is instantiated along with the after-table, and you can freely refer to it in procedural code.
When you pass a ProDataSet parameter, if the receiving procedure receives the ProDataSet as a static object, then its static definition must include a static name for the before-table. Otherwise, the AVM does not create a before-table and raises an error. The following figure shows how the before-table and after-table are related.

Actually,
the before-table has a non-unique index on the ROW-STATE,
so that changes are in order with delete operations first, then
modify operations, and then create operations.
Both the before-table and after-table are part of the ProDataSet. They are passed together as part of the ProDataSet parameter and have the same scope and lifetime, with the exception that a before-table for a dynamic temp-table is created only when first needed.
The arrows illustrate the four states and their relationships:
- When
OrderLine 09is modified, the before image is copied to a new record in the before-table. TheROW-STATEfor both records isROW-MODIFIED, represented by theMin the illustration. TheROW-STATEis not actually stored as a user-accessible temp-table column. It is accessible only through theROW-STATEattribute. - When row
11is created, a placeholder for it is created in the before-table. It serves only to log the creation and point to the record in the after-table. - When row
22is deleted, it is removed from the after-table and moved to the before-table. - Rows
10and77have aROW-STATEin the after-table ofROW-UNMODIFIED, represented by theU. There is no corresponding row in the before-table.