Progress
Language Reference


Temp-table Object Handle

Interfaces
OS
SpeedScript
All
All
Yes

A handle to a temp-table object. A temp-table object corresponds to an underlying Progress temp-table, which can be static or dynamic. An example of a static underlying temp-table is one you define at compile time with the DEFINE TEMP-TABLE statement. An example of a dynamic underlying temp-table is one you create at run time with the new CREATE TEMP-TABLE statement.

SYNTAX

temp-table-handle [ :attribute | :method ] 

temp-table-handle

An item of type WIDGET-HANDLE representing a handle to a temp-table object.

attribute

An attribute of the temp-table object.

Attribute
Type
Readable
Setable
HANDLE
LOGICAL
CHARACTER
LOGICAL
CHARACTER
LOGICAL

method

A method of the temp-table object.

Method
Return Type
Description
LOGICAL
Copies the specified source fields to the temp-table.
LOGICAL
Adds the named field to the named index of the temp-table.
LOGICAL
Adds a field like the specified field to the temp-table.
LOGICAL
Copies the named source index to the temp-table.
LOGICAL
Adds a new field with specified properties to the temp-table.
LOGICAL
Adds a new empty index to the temp-table.
LOGICAL
Empties the temp-table and
removes all table definitions. Changes the temp-table state to CLEAR.
LOGICAL
Copies the field definitions and indexes from the specified source table to the temp-table.
LOGICAL
Specifies that all the field and index definitions have been supplied. Changes the temp-table state to PREPARED.

EXAMPLE

The following code snippet demonstrates the creation, definition and use of a temp-table object.

DEFINE VARIABLE tth AS HANDLE.
DEFINE VARIABLE bh AS HANDLE.
DEFINE VARIABLE qh AS HANDLE.
DEFINE VARIABLE buf-cust-handle AS HANDLE.

/* get db table handle as usual */
buf-cust-handle = BUFFER customer:HANDLE.
/* create an "empty" undefined temp-table */
CREATE TEMP-TABLE tth.
/* give it customer’s fields and indexes */
tth:CREATE-LIKE(buf-cust-handle).
/* give it a single extra field */
tth:ADD-NEW-FIELD("f1","integer").
/* no more fields or indexes will be added to custx */
tth:TEMP-TABLE-PREPARE("custx").
/* get the buffer handle for the temp-table */
bh = tth:DEFAULT-BUFFER-HANDLE.
/*populate the table from customer table */
FOR EACH customer:
    bh:BUFFER-CREATE.
    bh:BUFFER-COPY(buf-cust-handle).
END.
/*run a query to access it*/
CREATE QUERY qh.
qh:SET-BUFFERS(bh).
qh:QUERY-PREPARE("for each custx where . . .").
. . . 

NOTES:

SEE ALSO

Buffer Object Handle, CREATE TEMP-TABLE Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095