SQL/MP Reference Manual

HP NonStop SQL/MP Reference Manual—523352-013
C-112
Examples—CONVERT
-- 03 DAY-SCHED OCCURS 1/5 TIMES
-- 04 DAYNUM
DAYNUM_1 PIC X(2) NOT NULL,
-- 04 SHIFTS OCCURS 1/2 TIMES
-- 05 START-HOUR
START_HOUR_1_1 PIC 9(2) NOT NULL,
-- 05 END-HOUR
END_HOUR_1_1 PIC 9(2) NOT NULL,
-- 05 START-HOUR
START_HOUR_1_2 PIC 9(2) NOT NULL,
-- 05 END-HOUR
END_HOUR_1_2 PIC 9(2) NOT NULL,
...
DAYNUM_5 PIC X(2) NOT NULL,
-- 04 SHIFTS OCCURS 1/2 TIMES
-- 05 START-HOUR
START_HOUR_5_1 PIC 9(2) NOT NULL,
...
END_HOUR_5_2 PIC 9(2) NOT NULL,
PRIMARY KEY (
DEP_KEY ,
EMP_KEY
)
)
ORGANIZATION KEY SEQUENCED
...
NO BUFFERED
;
Each elementary item of the OCCURS group is converted to a column. The two
fields of the EMPNUM-KEY group, which redefined EMPNUM, are used as the
primary key of the table. This command performs the conversion:
>> OBEY SCHDCONV;