SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual523352-013
C-101
DDL Clause Mapping
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.
The key specifier for each alternate key in the DDL record definition is used in the
KEYTAG clause of the CREATE INDEX command to associate a key specifier with an
index.
If a field name defined with a DDL REDEFINES clause is used as a primary or
alternate key, CONVERT determines which column is to be the key based on the
REDEFINE option of the CONVERT command. If you do not include the REDEFINE
option, CONVERT uses the original field as the key column.
For example, if the primary key CURRENT_DATA redefines EMPINFO, CONVERT
uses EMPINFO—not CURRENT_DATA—as the primary key. You can use the
REDEFINE option to specify that you want to use the redefined field instead of the
original one. For example, if you specify REDEFINE (EMPINFO AS
CURRENT_DATA), the CURRENT_DATA is used as the primary key.
Indexes are automatically loaded with data when the table is loaded.
DDL Clause Mapping
This DDL record definition clauses define constructs that are not used in SQL:
OCCURS and OCCURS DEPENDING ON clauses define repeating fixed or
varying groups or arrays. For SQL, each elementary item in the OCCURS group is
converted to a table column, and the table column is repeated a fixed number of
times. The names of repeated columns are derived from the DDL elementary item
name combined with the array index value. For OCCURS MIN TO MAX TIMES
DEPENDING ON field-name, table columns are repeated MAX number of
times.
Fields with FILLER clauses are skipped.
Conversion of a VALUE IS clause depends on the CONVERT option specified. The
two forms of the DDL VALUE IS clause used with PIC X, PIC A, and TYPE
CHARACTER fields are: