PROMPT Creating table FLIGHT_INFO_EXTRAS

CREATE TABLE flight_info_extras (
   flight_no                     CHAR(8) not null,
   flight_date                   CHAR(5) not null,
   ped                           DATE,
   sed                           DATE,
   box                           NUMBER,
   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 flight_info_extras add ( constraint flight_info_extras_pk primary key (appn_row_id) using index tablespace &1._indexes);

ALTER TABLE flight_info_extras ADD ( CONSTRAINT flight_info_extras_uk1 unique (flight_no,flight_date) USING INDEX TABLESPACE &1._indexes );

COMMENT ON TABLE FLIGHT_INFO_EXTRAS IS 'This table contains additional flight information from external systems';

COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.BOX IS  'Box number';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.FLIGHT_DATE IS  'Flight date';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.FLIGHT_NO IS  'Flight number';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.PED IS  'Public estimated time of departure';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.SED IS  'Staff estimated time of departure';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.CUSER IS 'The user who created the row';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN FLIGHT_INFO_EXTRAS.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';

