CREATE TABLE |
Create Keyed File (EFF) |
CREATE TABLE filename$,[,extkey_len][,key_def$][,max_recs][,rec_size][,fileopt]
Where:
filename$ |
Name of the Keyed file to create. String expression. | ||||||||||||||||||||||
extkey_len |
Numeric expression. Length of the external key for all records in the file. | ||||||||||||||||||||||
key_def$ |
String expression defining the key. The Keyed file can be single or multi-keyed. A key definition is made up of one or more key field definitions ranging from 0 to 15 for FLR/VLR files or 0 to 255 for EFF files. Use integers for specific field numbers, 0 (zero for record-based offsets) or KEY to reference a value based on an external key. The key definition formats are as follows:
Where:
| ||||||||||||||||||||||
max_recs |
Maximum number of records the file is allowed. Optional numeric expression. The default is zero (no limit). (Use a comma with no value to set the default.) If a positive value is supplied, PxPlus creates and pre-allocates disk space for the file. With a negative value, PxPlus allocates sufficient disk space for the file but will set the max_recs count back to zero (unlimited). | ||||||||||||||||||||||
rec_size |
Maximum size of the data portion of the record (excluding the key). A negative value creates a variable-length record (VLR) data file with the maximum record length equal to the positive value of this field. A positive value creates a fixed-length record (FLR) formatted file. If you do not specify size, the default is VLR with a maximum record size of 256. | ||||||||||||||||||||||
fileopt |
Supported file options (see File Options):
|
Use the CREATE TABLE directive to create a file with one or more keys. If the first field in the directive after the filename is a number, PxPlus creates an external file key (i.e. an index to the file). If the first field in the directive is a key definition enclosed in square brackets [ ], then PxPlus uses only internal key fields instead.
PxPlus considers the first key specified for an EFF file to be the primary key. Every record must have a unique primary key. You can have duplicate secondary keys from record to record. There is a maximum of 255 keys allowed on a file with a maximum of 255 data components making up these 255 keys. For VLR/FLR files, there is a maximum of 16 key fields allowed on a file with a maximum of 96 data components making up the 16 keys. There is no limit (other than the maximum of 96 key components) to the number of fields that comprise a key.
If a given filename already exists, PxPlus returns Error #12: File does not exist (or already exists).
Keys have the following limits:
Enhanced File Format (EFF) Notes
EFF records are always variable length. In future, EFF files will support transactions. See SYSTEM_JRNL directive.
The following file limitations exist for EFF files:
|
1. |
63Kb (64512 bytes) is the maximum block size. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
2. |
The maximum record size is 64000 bytes. When using extended records, the record size is limited to 32000 bytes when created, although records can be as large as 2GB. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
3. |
EFF files do not support the multi-segmented techniques available for VLR files. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4. |
Refer to the table for sample file size limitations. The block size determines the maximum file size. EFF files will only use 3-byte pointers (as of PxPlus v6.00). The ability to use 4-byte pointers is part of the design to allow larger file sizes and will be enabled in a future version of PxPlus.
|
KEYED Create Single/Multi-Keyed File
DIRECT Create File with Keyed Access
SYSTEM_JRNL File System Journalization
ADD INDEX Add Key to Keyed File
DROP INDEX Drop Key from Keyed File
RENAME..INDEX Rename Keys in Keyed File
SORT Create File for Sorting