NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
C-103
Examples—CONVERT
LOW KEY value must be a valid FIRST KEY value in a CREATE TABLE
command.
Partitioned Enscribe alternate key files are converted to partitioned SQL indexes.
Examples—CONVERT
Suppose that you have a key-sequenced Enscribe file named ORDERTAB on
subvolume $VOL3.DDL. The contents of the Enscribe file are described by the
record definition ORDER. The record ORDER includes two DDL groups named
ORDERDATE and DELDATE. The record definition also indicates that the primary
key is ORDERNUM and that the alternate key field is CUSTNUM.
Here is the DDL record definition for the ORDER file:
RECORD ORDER.
FILE IS "$VOL3.DDL.ORDERTAB" KEY-SEQUENCED.
02 ORDERNUM PIC 9(3).
02 ORDERDATE.
03 MONTH PIC 9(2).
03 DAY PIC 9(2).
03 YEAR PIC 9(2).
02 DELDATE.
03 MONTH PIC 9(2).
03 DAY PIC 9(2).
03 YEAR PIC 9(2).
02 SALES-PERSON PIC X(4).
02 BRANCHNUM TYPE BINARY 32 NULL RaS VALUE IS 9999.
02 CUSTNAME.
03 LEN PIC S9(4) COMP.
03 VAL PIC X(30) VALUE IS "RINTERNALS".
02 CUSTNUM PIC 9(4).
02 STATUS PIC X(8) VALUE IS "RON HOLDS".
02 TOTAL-AMOUNT PIC 9(5)V9(2) NULL 0.
KEY IS ORDERNUM DUPLICATES NOT ALLOWED.
KEY "oc" IS CUSTNUM.
END
Assume that your current default subvolume is $VOL3.DDL and that you want to
convert the Enscribe file ORDERTAB to a table named ORDERS on the subvolume
$VOL1.SALES. ORDERTAB resides on the current default subvolume and is