Progress
Language Reference


ADD-FIELDS-FROM( ) Method

This method copies the field definitions from the specified source table. It is intended for use when a temp-table represents a join. If it finds fields that are already in the temp-table, it ignores them.

This method cannot be called after TEMP-TABLE-PREPARE( ) has been called unless CLEAR( ) is called first.

Return Type: LOGICAL

Applies To: Temp-table Object Handle

SYNTAX
ADD-FIELDS-FROM( { source-table-hndl-exp | source-table-name-exp }
   [ , except-list-exp ] ) 

source-table-hndl-exp

An expression that evaluates to a table handle from which to copy the field definitions.

source-table-name-exp

An expression that evaluates to a table name from which to copy the field definitions.

except-list-exp

A character expression that evaluates to a comma-separated list of field names to be excluded from the new table definition.

This method does not create any indexes. Either indexes must be added specifically through one of the ADD-INDEX methods, or a default index is created.

The following example fragment creates a join temp-table from the customer and order tables:

DEFINE tth AS HANDLE.
CREATE TEMP-TABLE tth.
tth:ADD-FIELDS-FROM("customer").
tth:ADD-FIELDS-FROM("order").
tth:TEMP-TABLE-PREPARE("cust-ord").
. . . 

The following fragment creates a temp-table from the customer table except for the sales-rep field:

tth:ADD-FIELDS-FROM("customer","sales-rep"). 

NOTE: There is a limit to the number of fields that can be accommodated in a temp-table object. The limit depends on how large the field information (initial value, validate information, help messages, etc.) is, but you should plan on a limit of 500 fields.


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