Difference between revisions of "CREATE FROM"

From Lianjapedia
Jump to: navigation, search
 
Line 11: Line 11:
 
The CREATE FROM command creates a new table, determined by the contents of a table created with the COPY STRUCTURE EXTENDED command.  The filenames can be substituted with a <expC1>, enclosed in round brackets, which returns a valid filename.  The FROM table consists of five fields, these are:
 
The CREATE FROM command creates a new table, determined by the contents of a table created with the COPY STRUCTURE EXTENDED command.  The filenames can be substituted with a <expC1>, enclosed in round brackets, which returns a valid filename.  The FROM table consists of five fields, these are:
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
!Field||Type||Width||width=45%|Description
+
!Field||Type||Width||width="45%"|Description
 
|-
 
|-
 
|FIELD_NAME||Character||32||Field name
 
|FIELD_NAME||Character||32||Field name

Latest revision as of 08:57, 5 February 2013

Purpose

Create a table from the contents of another table

Syntax

CREATE <filename1> | (<expC1>) FROM <filename2> | (<expC2>)

See Also

COPY, COPY STRUCTURE, COPY STRUCTURE EXTENDED

Description

The CREATE FROM command creates a new table, determined by the contents of a table created with the COPY STRUCTURE EXTENDED command. The filenames can be substituted with a <expC1>, enclosed in round brackets, which returns a valid filename. The FROM table consists of five fields, these are:

Field Type Width Description
FIELD_NAME Character 32 Field name
FIELD_TYPE Character 1 Data type of field
FIELD_LEN Numeric 3 Width of field
FIELD_DEC Numeric 3 Number of decimal places
FIELD_DES Character 25 Field Description

Each record of the FROM table defines a field. The structure of the new table, <filename1>, will be created from these field definitions.

Example

use patrons
copy structure extended to patstru
close patrons
create newpatron from patstru