PROMPT Creating table ULD_RECORDED_ID_CODES

CREATE TABLE uld_recorded_id_codes (
   uld_id_code                   VARCHAR2 (10) NOT NULL,
   template_name                 VARCHAR2 (30) DEFAULT 'DUMMY' NOT NULL,
   agent                         VARCHAR2 (30) DEFAULT 'ULTRA' NOT NULL,
   card_id                       NUMBER   (10) DEFAULT 1 NOT NULL,
   flight_no                     VARCHAR2 (8),
   flight_date                   VARCHAR2 (5),
   uld_category                  VARCHAR2 (5),
   uld_type                      VARCHAR2 (1),
   dest1                         VARCHAR2 (3),
   dest2                         VARCHAR2 (3),
   dest3                         VARCHAR2 (3),
   dest4                         VARCHAR2 (3),
   dest5                         VARCHAR2 (3),
   dest6                         VARCHAR2 (3),
   class1                        VARCHAR2 (10),
   class2                        VARCHAR2 (10),
   class3                        VARCHAR2 (10),
   class4                        VARCHAR2 (10),
   class5                        VARCHAR2 (10),
   class6                        VARCHAR2 (10),
   uld_no                        CHAR     (10),
   uld_id_code_created           DATE NOT NULL,
   site_id                       NUMBER (10) NOT NULL,
   contents_remarks              VARCHAR2(30),
   remarks                       VARCHAR2(30),
   onward_flight_no1             VARCHAR2 (8),
   onward_flight_date1           VARCHAR2 (5),
   onward_flight_no2             VARCHAR2 (8),
   onward_flight_date2           VARCHAR2 (5),
   onward_flight_no3             VARCHAR2 (8),
   onward_flight_date3           VARCHAR2 (5),
   onward_flight_no4             VARCHAR2 (8),
   onward_flight_date4           VARCHAR2 (5),
   onward_flight_no5             VARCHAR2 (8),
   onward_flight_date5           VARCHAR2 (5),
   onward_flight_no6             VARCHAR2 (8),
   onward_flight_date6           VARCHAR2 (5),
   row_create_time               date,
   row_date_time                 date,
   cuser                         varchar2(30),
   muser                         varchar2(30),
   mterm                         varchar2(64),
   source                        varchar2(8),
   to_be_archived                varchar2(1),
   appn_row_id                   number(18) not null,
   system_id                     number(4) default 0 not null
);

alter table uld_recorded_id_codes add ( constraint uld_recorded_id_codes_pk primary key (appn_row_id) using index tablespace &1._indexes);

ALTER TABLE uld_recorded_id_codes ADD CONSTRAINT uld_recorded_id_codes_uk1 unique ( uld_id_code) USING INDEX TABLESPACE &1._indexes;

CREATE index uld_recorded_id_codes_sk1 ON ULD_RECORDED_ID_CODES( template_name,agent,card_id) TABLESPACE &1._indexes;

COMMENT ON TABLE ULD_RECORDED_ID_CODES IS 'This table contains ...';

COMMENT ON COLUMN ULD_RECORDED_ID_CODES.AGENT IS  'Agent code';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.CARD_ID IS  'Card identifier';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.CLASS1 IS  'Class associated with the first onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.CLASS2 IS  'Class associated with the second onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.CLASS3 IS  'Class associated with the third onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.CLASS4 IS  'Class associated with the fourth onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.CLASS5 IS  'Class associated with the fifth onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.CLASS6 IS  'Class associated with the sixth onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.CONTENTS_REMARKS IS  'Free text remarks';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.DEST1 IS  'Destination for the first flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.DEST2 IS  'Destination for the second flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.DEST3 IS  'Destination for the third flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.DEST4 IS  'Destination for the fourth flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.DEST5 IS  'Destination for the fifth flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.DEST6 IS  'Destination for the sixth flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.FLIGHT_DATE IS  'Flight date';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.FLIGHT_NO IS  'Flight number';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_DATE1 IS  'Date of the first onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_DATE2 IS  'Date of the second onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_DATE3 IS  'Date of the third onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_DATE4 IS  'Date of the fourth onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_DATE5 IS  'Date of the fifth onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_DATE6 IS  'Date of the sixth onward flight';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_NO1 IS  'First onward flight number';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_NO2 IS  'Second onward flight number';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_NO3 IS  'Third onward flight number';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_NO4 IS  'Fourth onward flight number';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_NO5 IS  'Fifth onward flight number';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ONWARD_FLIGHT_NO6 IS  'Sixth onward flight number';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.REMARKS IS  'Free text remarks';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.SITE_ID IS  'Site identifier';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.TEMPLATE_NAME IS  'Template name';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ULD_CATEGORY IS  'ULD category';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ULD_ID_CODE IS  'ULD identifier code';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ULD_ID_CODE_CREATED IS  'Date ULD ID code created';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ULD_NO IS  'ULD number';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ULD_TYPE IS  'ULD type';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.CUSER IS 'The user who created the row';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN ULD_RECORDED_ID_CODES.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
