PROMPT Creating table INBOUND_PAX_ONWARD_DESTS

create table INBOUND_PAX_ONWARD_DESTS
(
   INBOUND_PAX_ID                NUMBER(10) not null,
   DESTINATION_SEQUENCE          NUMBER(6) default 1 not null,
   ONWARD_FLIGHT_NO              CHAR(8),
   ONWARD_FLIGHT_DATE            CHAR(5),
   ONWARD_DESTINATION            CHAR(3),
   ONWARD_CLASS                  CHAR(1),
   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 inbound_pax_onward_dests add ( constraint inbound_pax_onward_dests_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table inbound_pax_onward_dests add ( constraint inbound_pax_onward_dests_uk1 unique (INBOUND_PAX_ID,DESTINATION_SEQUENCE) using index tablespace &1._indexes);

alter table INBOUND_PAX_ONWARD_DESTS add constraint INBOUND_PAX_ONWARD_DESTS_FK foreign key (INBOUND_PAX_ID) references INBOUND_PAX (INBOUND_PAX_ID) on delete cascade;

COMMENT ON TABLE INBOUND_PAX_ONWARD_DESTS IS 'This table contains details about onward destinations for inbound passengers';

COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.DESTINATION_SEQUENCE IS  'Destination 1 is the current airport. Through or transfer passengers should have at least 1 additional destination';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.INBOUND_PAX_ID IS  'Passenger ideintifer';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.ONWARD_CLASS IS  'Onward class';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.ONWARD_DESTINATION IS  'Onward destination';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.ONWARD_FLIGHT_DATE IS  'Onward flight date';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.ONWARD_FLIGHT_NO IS  'Onward flight number';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.CUSER IS 'The user who created the row';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN INBOUND_PAX_ONWARD_DESTS.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
