NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
C-96
Enscribe Files and DDL Record Definitions
The CONVERT utility does not check any version information; therefore, the versions
of the table and any indexes you are creating cannot be greater than the version of the
catalog in which they will be registered.
CONVERT supports the HEADING, UPSHIFT, and HELP TEXT attributes.
Enscribe Files and DDL Record Definitions
CONVERT operates on Enscribe files only. CONVERT derives a table's file
organization and primary key location from the Enscribe file and derives column names
and column data types from the DDL record definition for the Enscribe file. CONVERT
also generates commands to create indexes on the table from the alternate key
specifications in the Enscribe file.
When a structured Enscribe file is converted to a table, the table is assigned the same file
organization as the file: key-sequenced, relative, or entry-sequenced. An unstructured
file is converted to an entry-sequenced table.
The file must have an associated DDL record definition. The actual file organization and
record length must be the same as the specifications for these attributes in the DDL
record definition.
If a DDL record definition defines an elementary item or group by means of a DDL
DEF structure, CONVERT uses the DEFs to convert the record definition, but a DEF
does not translate to an SQL data structure. During the conversion of a record definition,
CONVERT echoes the SQL table definition on the home terminal screen. (If you work
with data that includes multibyte characters, be aware that column DEFAULT clauses
can contain multibyte characters unsupported by the terminal and this can cause
unpredictable results in the screen display.)
DDL Primary Keys and Alternate Keys
CONVERT uses the primary key specification in the Enscribe file to assign the primary
key of the table. The SQL primary key is defined on columns derived from a field or
fields specified in the DDL record definition. If the key definition spans multiple fields,
a multicolumn SQL primary key is produced.
CONVERT uses the alternate key specifications in the Enscribe file to define indexes on
the table. Because SQL requires a separate index file for each alternate key, a CREATE
INDEX command is generated for each alternate key named in the DDL record
definition.
Indexes are created on the same volume and subvolume as the table. Index names are
created by appending numbers to the table name. The name of the tables, therefore,
should be shorter than eight characters. For example, the first index of the DEPT table is
DEPT0, the second is DEPT1, and so forth.
You can use the MAP NAME option to override this naming pattern. Using the MAP
NAMES option, you can map the name of an alternate-key file to an index name. If
other index names are needed, they are created by appending numbers to the index name
specified in the MAP NAMES option.