Create and use dynamic temp-tables
- Last Updated: May 7, 2024
- 3 minute read
- OpenEdge
- Version 12.8
- Documentation
- A temp-table lets you create business logic that is independent of the particular structure of the underlying data source.
- A temp-table is the mechanism you use for passing records from one OpenEdge session to another, in particular from an application server session where the database resides to a client session where the user interface for the application is.
This section expands on your knowledge of temp-tables by introducing you to dynamic temp-tables. It also introduces you to the attributes you can access and the methods you can invoke using a handle to either a static or dynamic temp-table.
Finally, this section details the various ways in which you can pass a temp-table from one procedure or one session to another.
|
- There are only a few attributes you can access through a temp-table’s handle, and none of these are settable for a static table.
- None of the temp-table methods are usable for a static temp-table.
These methods define the fields and indexes for the temp-table. You cannot change or extend the fields or indexes for a static temp-table.
|
There are no other options on the CREATE TEMP-TABLE statement. You
specify everything about the table after you create it. Thus, the
CREATE statement really does nothing more than set up the
tt-handle variable to be a handle for a temp-table structure to
fill in later.
A dynamic temp-table can be in one of three states. When you first create it, using just
the CREATE TEMP-TABLE statement, it is said to be in the clear state.
That is, the temp-table handle has been allocated but there is no definition for the
table yet. After you start to use the temp-table methods to define the table’s fields
and indexes, the table is said to be unprepared. This means that the table definition is
not yet complete and you cannot start to use the table. After you complete the
definition using its methods, you use a special TEMP-TABLE-PREPARE
method to signal to the ABL Virtual machine (AVM) that the definition is complete. This
effectively freezes the definition and allows you to start to use the table to store
data. At this point, the temp-table is in the prepared state.