PROMPT Creating table WORK_FLIGHT_SELECT

CREATE TABLE WORK_FLIGHT_SELECT ( 
   ORIG_FLIGHT_ID                NUMBER (10)   NOT NULL,    
   FLIGHT_ID                     NUMBER (10)	 NOT NULL,
   FLIGHT_NO                     CHAR (8)      NOT NULL,
   FLIGHT_DATE                   CHAR (5)      NOT NULL, 
   FLIGHT_SCH_TIME               CHAR (4)      NOT NULL, 
   WEIGHTING                     DATE  NOT NULL, 
   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 work_flight_select add ( constraint work_flight_select_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table work_flight_select add ( constraint work_flight_select_uk1 unique (orig_flight_id,flight_id) using index tablespace &1._indexes);

COMMENT ON TABLE WORK_FLIGHT_SELECT IS 'This table is used by reflighting when searching for the list of possible flights the bag may be re-flighted to';

COMMENT ON COLUMN WORK_FLIGHT_SELECT.FLIGHT_DATE IS  'Flight date';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.FLIGHT_ID IS  'Flight identifier';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.FLIGHT_NO IS  'Flight number';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.FLIGHT_SCH_TIME IS  'Scheduled time of departure';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.ORIG_FLIGHT_ID IS  'Original flight identifier';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.WEIGHTING IS  'Weighting';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.CUSER IS 'The user who created the row';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN WORK_FLIGHT_SELECT.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
