Creates a new table whose records contain the structure of the current table.

Syntax

COPY STRUCTURE EXTENDED TO <filename>
[[TYPE] PARADOX | DBASE]

or

COPY TO <filename>
STRUCTURE EXTENDED
[[TYPE] PARADOX | DBASE]

<filename>

The name of the table that you want to create to contain the structure of the current table.

[TYPE] PARADOX | DBASE

Specifies the type of table you want to create, if <filename> does not include an extension. This option overrides the current SET DBTYPE setting. The TYPE keyword is included for readability only; it has no effect on the operation of the command.

Description

COPY STRUCTURE EXTENDED copies the structure of the current table to records in a new table.

COPY STRUCTURE EXTENDED first defines a table, called a structure-extended table, containing five fields of fixed names, types, and lengths. Once the structure-extended table is defined, COPY STRUCTURE EXTENDED appends records that provide information about each field in the current table. The fields in the structure-extended table store the following information about fields in the current table:

Field

Contents

FIELD_NAME

Character field that contains the name of the field.

FIELD_TYPE

Character field that contains the field's data type.

FIELD_LEN

Numeric field that contains the field length.

FIELD_DEC

Numeric field that contains the number of decimal places for numeric fields.

FIELD_IDX

Character field that indicates if index tags were created on individual fields in the table.

When the process is complete, the structure-extended table contains as many records as there are fields in the current table. You can then use CREATE...FROM to create a new table from the information provided by the structure-extended table.

No record is created in the structured-extended table for the _DBASELOCK field created with the CONVERT command.

OODML

Use the Database objectís executeSQL(†) method to call the SQL command CREATE TABLE (see CREATE STUCTURE EXTENDED) to create the structure-extended table. Then use a loop to populate the table with information from the array of Field objects.