CREATE TEMP-TABLE statement
- Last Updated: October 18, 2024
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
Creates a TEMP-TABLE dynamically at run time. The TEMP-TABLE that is created is empty and must be defined using ADD/CREATE methods.
Syntax
|
- handle
- A variable of type HANDLE that represents the handle of the TEMP-TABLE object.
- IN WIDGET-POOL widget-pool-name
- An expression of type CHARACTER that evaluates, at run time,
to the name of the widget pool that contains the dynamic TEMP-TABLE.Note: Widget pool names are not case-sensitive.
Note
You can collect run-time statistics about usage of temp-tables in an ABL session. For more information on collecting statistics for temp-table usage, see Troubleshoot ABL Applications.
Example
The
following example creates a TEMP-TABLE like the Order table
and populates it from the Order table. In addition,
the corresponding SalesRep name is added from the SalesRep table,
as shown:
r-cretmpt.p
|
Notes
- Once the TEMP-TABLE fields and indexes are defined using the ADD/CREATE methods, the definition must be terminated by using the TEMP-TABLE-PREPARE method before the TEMP-TABLE can be used.
- You can set the before-table-exp parameter to TRUE in the TEMP-TABLE-PREPARE method to explicitly create a before-table for a dynamic temp-table. See the TEMP-TABLE-PREPARE method entry for more information.
- Once the TEMP-TABLE is prepared, it can be manipulated by using its buffer object handle which is retrieved using the DEFAULT-BUFFER-HANDLE attribute. All the BUFFER methods are available to the dynamic TEMP-TABLE.
- The dynamic temp-table object is scoped like the buffer object. It is created in a widget pool and ends when the widget pool ends or when it is deleted with the DELETE OBJECT statement. You may not delete the default buffer object belonging to a dynamic temp-table.
- Errors for dynamic temp-tables do not automatically raise the ERROR condition since they occur inside a widget expression. All the methods that can have errors return FALSE if an error occurs, so they must be tested. If NO-ERROR is in effect in the statement containing the widget reference, no messages display, but they can be retrieved from the ERROR-STATUS system handle.