NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
C-106
Examples—CONVERT
The following example is the DDL record definition for the key-sequenced Enscribe
file called TSTKANJI and uses the Kanji data type:
RECORD kanji.
FILE IS "$vol1.subvol1.tstkanji" KEY-SEQUENCED.
02 A PIC N.
02 B PIC N VALUE IS N"aa".
02 C PIC N(4).
02 D PIC N(3) VALUE IS N"abcdef".
02 E PIC N(5) VALUE IS N"abcdefghij".
02 F PIC N(4) REDEFINES E.
02 G.
03 LEN PIC S9(4) COMP.
03 VAL PIC N(4).
KEY IS C DUPLICATES NOT ALLOWED.
END
The following command creates an EDIT file named CNVSRC that contains the
commands needed to convert the DDL record definition to an SQL table:
>> CONVERT RECORD kanji TO TABLE $vol2.subvol2.kanjitbl;
Note that the CONVERT command does not include the REDEFINE clause, so F in
the DDL record definition is ignored and does not redefine E.
CNVSRC contains the following CREATE TABLE command:
?SECTION CREATE_KANJITBL
CREATE TABLE \NODE.$VOL2.SUBVOL2.KANJITBL
(
A PIC X(2) NOT NULL , -- WARNING - PIC N
B PIC X(2) -- WARNING - PIC N
DEFAULT "aa" NOT NULL ,
--WARNING Default literal originally national language
string
C PIC X(8) NOT NULL , -- WARNING - PIC N
D PIC X(6) -- WARNING - PIC N
DEFAULT "abcdef" NOT NULL ,
--WARNING Default literal originally national language
string