Difference between revisions of "COPY STRUCTURE EXTENDED"
Yvonne.milne (Talk | contribs) m (1 revision) |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Create a table with records containing field definitions | Create a table with records containing field definitions | ||
− | |||
==Syntax== | ==Syntax== | ||
COPY STRUCTURE EXTENDED TO <.dbf filename> | (<expC>) [FIELDS <field list>] | COPY STRUCTURE EXTENDED TO <.dbf filename> | (<expC>) [FIELDS <field list>] | ||
− | |||
==See Also== | ==See Also== | ||
− | [[COPY]], [[COPY FILE]], [[COPY STRUCTURE]], [[CREATE FROM | + | [[COPY]], [[COPY FILE]], [[COPY STRUCTURE]], [[CREATE FROM]], [[REPLACE]] |
− | + | ||
==Description== | ==Description== | ||
Line 38: | Line 35: | ||
====FIELDS <field list>==== | ====FIELDS <field list>==== | ||
If the optional FIELDS clause is specified, then the operation is restricted to those fields named in the comma separated <field list>. | If the optional FIELDS clause is specified, then the operation is restricted to those fields named in the comma separated <field list>. | ||
− | |||
==Example== | ==Example== | ||
Line 48: | Line 44: | ||
</code> | </code> | ||
− | |||
− | |||
− | |||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
[[Category:Table Basics]] | [[Category:Table Basics]] | ||
[[Category:Table Basics Commands]] | [[Category:Table Basics Commands]] |
Revision as of 10:40, 9 February 2012
Contents
Purpose
Create a table with records containing field definitions
Syntax
COPY STRUCTURE EXTENDED TO <.dbf filename> | (<expC>) [FIELDS <field list>]
See Also
COPY, COPY FILE, COPY STRUCTURE, CREATE FROM, REPLACE
Description
The COPY STRUCTURE EXTENDED command operates on the currently active table and creates a new table with records containing the active table's structure. The new table has five fields:
Field | Type | Length | Description |
---|---|---|---|
FIELD_NAME | Character | 32 | Field name |
FIELD_TYPE | Character | 1 | Data type |
FIELD_LEN | Numeric | 3 | Width of field |
FIELD_DEC | Numeric | 3 | Number of decimal places |
FIELD_DES | Character | 25 | Field description |
A record is created for each field from the active table, so that each record contains a complete field definition. Once a table has been created in this manner, it can be used to build a new table structure. The records containing the field definitions can be modified in the same way as any standard records (EDIT, REPLACE etc). The CREATE FROM command can then use this structure table as the source for a new table.
TO <.dbf filename>
The TO <.dbf filename> can be substituted with any <expC>, enclosed in round brackets, which returns a valid filename.
FIELDS <field list>
If the optional FIELDS clause is specified, then the operation is restricted to those fields named in the comma separated <field list>.
Example
use patrons copy structure extended to patstru select workarea() create newpatrons from patstru