PROMPT Creating table MACH_FLIGHT_INFO

create table mach_flight_info (
   id                            number not null,
   timestamp                     date,
   direction                     char(1)   NOT NULL,
   set_type                      char(1),
   plan_date                     date,
   airline                       char(3)   NOT NULL,
   flight_no                     char(5)    NOT NULL,
   charter_id                    char(1),
   regi                          char(2),
   mail_id                       char(1),
   position                      char(4),
   vip_id                        char(1),
   type                          char(3),
   freight_id                    char(1),
   schedule                      char(4),
   change                        char(1),
   blo_time                      char(4),
   blo_id                        char(4),
   departure_delay               char(2),
   note                          char(1),
   gate                          char(2),
   blink_id                      char(1),
   call_1                        char(4),
   call_2                        char(1),
   bus                           char(1),
   special_load                  char(1),
   load                          char(1),
   eff_dat                       date,
   delay_int                     char(4),
   code                          char(1),
   pos_old                       char(2),
   destination                   char(24),
   de_ice                        char(1),
   effect_time                   char(4),
   landed_id                     char(1),
   block_in_delay                char(2),
   hyphen                        char(3),
   eff_dat_co                    char(8),
   airl_co                       char(3),
   flnr_co                       char(5),
   time_co                       char(4),
   time_co_code                  char(1),
   load_bus_co                   char(2),
   pos_co_old                    char(2),
   belt                          char(2),
   origin                        char(24),
   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 mach_flight_info add ( constraint mach_flight_info_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table mach_flight_info add ( constraint mach_flight_info_uk1 unique (id) using index tablespace &1._indexes );
 
alter table mach_flight_info add ( constraint mach_flinfo_check_direction check ( direction in ('I', 'O') ));

COMMENT ON TABLE MACH_FLIGHT_INFO IS 'This table contains flight information inserted by the MACH Fids interface at VIENNA';

COMMENT ON COLUMN MACH_FLIGHT_INFO.AIRLINE IS  'Airline';
COMMENT ON COLUMN MACH_FLIGHT_INFO.AIRL_CO IS  'Carrier code';
COMMENT ON COLUMN MACH_FLIGHT_INFO.BELT IS  'Belt number';
COMMENT ON COLUMN MACH_FLIGHT_INFO.BLINK_ID IS  'Blink identifier';
COMMENT ON COLUMN MACH_FLIGHT_INFO.BLOCK_IN_DELAY IS  'Block in delay in minutes';
COMMENT ON COLUMN MACH_FLIGHT_INFO.BLO_ID IS  'Block identifier';
COMMENT ON COLUMN MACH_FLIGHT_INFO.BLO_TIME IS  'Off Blocks time';
COMMENT ON COLUMN MACH_FLIGHT_INFO.BUS IS  'Number of buses';
COMMENT ON COLUMN MACH_FLIGHT_INFO.CALL_1 IS  'First callout';
COMMENT ON COLUMN MACH_FLIGHT_INFO.CALL_2 IS  'Second callout';
COMMENT ON COLUMN MACH_FLIGHT_INFO.CHANGE IS  'Change indicator';
COMMENT ON COLUMN MACH_FLIGHT_INFO.CHARTER_ID IS  'Indicates charter flight';
COMMENT ON COLUMN MACH_FLIGHT_INFO.CODE IS  'Function code';
COMMENT ON COLUMN MACH_FLIGHT_INFO.DELAY_INT IS  'Internal delay (HHMM)';
COMMENT ON COLUMN MACH_FLIGHT_INFO.DEPARTURE_DELAY IS  'Departure delay in minutes';
COMMENT ON COLUMN MACH_FLIGHT_INFO.DESTINATION IS  'Destination';
COMMENT ON COLUMN MACH_FLIGHT_INFO.DE_ICE IS  'De-ice indicator';
COMMENT ON COLUMN MACH_FLIGHT_INFO.DIRECTION IS  'Flight direction (inbound or outbound)';
COMMENT ON COLUMN MACH_FLIGHT_INFO.EFFECT_TIME IS  'Effective time';
COMMENT ON COLUMN MACH_FLIGHT_INFO.EFF_DAT IS  'Effective date';
COMMENT ON COLUMN MACH_FLIGHT_INFO.EFF_DAT_CO IS  'Effective date correction';
COMMENT ON COLUMN MACH_FLIGHT_INFO.FLIGHT_NO IS  'Flight number';
COMMENT ON COLUMN MACH_FLIGHT_INFO.FLNR_CO IS  'Flight number correction';
COMMENT ON COLUMN MACH_FLIGHT_INFO.FREIGHT_ID IS  'Indicates freight';
COMMENT ON COLUMN MACH_FLIGHT_INFO.GATE IS  'Gate number';
COMMENT ON COLUMN MACH_FLIGHT_INFO.HYPHEN IS  'Hyphen';
COMMENT ON COLUMN MACH_FLIGHT_INFO.ID IS  'Unique identifier';
COMMENT ON COLUMN MACH_FLIGHT_INFO.LANDED_ID IS  'Landed indicator';
COMMENT ON COLUMN MACH_FLIGHT_INFO.LOAD IS  'Load indication';
COMMENT ON COLUMN MACH_FLIGHT_INFO.LOAD_BUS_CO IS  'Load bus correction';
COMMENT ON COLUMN MACH_FLIGHT_INFO.MAIL_ID IS  'Indicates mail';
COMMENT ON COLUMN MACH_FLIGHT_INFO.NOTE IS  'Note';
COMMENT ON COLUMN MACH_FLIGHT_INFO.ORIGIN IS  'Originating airport';
COMMENT ON COLUMN MACH_FLIGHT_INFO.PLAN_DATE IS  'Date of operation';
COMMENT ON COLUMN MACH_FLIGHT_INFO.POSITION IS  'Stand position';
COMMENT ON COLUMN MACH_FLIGHT_INFO.POS_CO_OLD IS  'Old position correction';
COMMENT ON COLUMN MACH_FLIGHT_INFO.POS_OLD IS  'Old position';
COMMENT ON COLUMN MACH_FLIGHT_INFO.REGI IS  'Aircraft registration';
COMMENT ON COLUMN MACH_FLIGHT_INFO.SCHEDULE IS  'Scheduled flight time';
COMMENT ON COLUMN MACH_FLIGHT_INFO.SET_TYPE IS  'Set type';
COMMENT ON COLUMN MACH_FLIGHT_INFO.SPECIAL_LOAD IS  'Special load indicator';
COMMENT ON COLUMN MACH_FLIGHT_INFO.TIMESTAMP IS  'Time row was created';
COMMENT ON COLUMN MACH_FLIGHT_INFO.TIME_CO IS  'Time correction';
COMMENT ON COLUMN MACH_FLIGHT_INFO.TIME_CO_CODE IS  'Time correction code';
COMMENT ON COLUMN MACH_FLIGHT_INFO.TYPE IS  'Aircraft type';
COMMENT ON COLUMN MACH_FLIGHT_INFO.VIP_ID IS  'Indicates VIP';
COMMENT ON COLUMN MACH_FLIGHT_INFO.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN MACH_FLIGHT_INFO.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN MACH_FLIGHT_INFO.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN MACH_FLIGHT_INFO.CUSER IS 'The user who created the row';
COMMENT ON COLUMN MACH_FLIGHT_INFO.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN MACH_FLIGHT_INFO.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN MACH_FLIGHT_INFO.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN MACH_FLIGHT_INFO.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN MACH_FLIGHT_INFO.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
