PROMPT Creating table INBOUND_ULD_DESTS

create table INBOUND_ULD_DESTS (
   INBOUND_ULD_ID                NUMBER(10) not null,
   DESTINATION_SEQUENCE          NUMBER(6) not null,
   DESTINATION                   CHAR(3) not null,
   CLASS_LIST                    CHAR(10) not null,
   ONWARD_FLIGHT_NO              CHAR(8),
   ONWARD_FLIGHT_DATE            CHAR(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 inbound_uld_dests add ( constraint inbound_uld_dests_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table inbound_uld_dests add ( constraint inbound_uld_dests_uk1 unique (INBOUND_ULD_ID,DESTINATION_SEQUENCE) using index tablespace &1._indexes);

alter table INBOUND_ULD_DESTS add constraint INBOUND_ULD_DESTS_FK_INBND_ULD foreign key (INBOUND_ULD_ID) references INBOUND_ULD (INBOUND_ULD_ID) on delete cascade;

COMMENT ON TABLE INBOUND_ULD_DESTS IS 'This table contains details of onward ULD destinations ';

COMMENT ON COLUMN INBOUND_ULD_DESTS.CLASS_LIST IS  'ULD class list';
COMMENT ON COLUMN INBOUND_ULD_DESTS.DESTINATION IS  'ULD destination';
COMMENT ON COLUMN INBOUND_ULD_DESTS.DESTINATION_SEQUENCE IS  'Sequence of this destination';
COMMENT ON COLUMN INBOUND_ULD_DESTS.INBOUND_ULD_ID IS  'ULD identifier';
COMMENT ON COLUMN INBOUND_ULD_DESTS.ONWARD_FLIGHT_DATE IS  'Onward flight date';
COMMENT ON COLUMN INBOUND_ULD_DESTS.ONWARD_FLIGHT_NO IS  'Onward flight number';
COMMENT ON COLUMN INBOUND_ULD_DESTS.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN INBOUND_ULD_DESTS.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN INBOUND_ULD_DESTS.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN INBOUND_ULD_DESTS.CUSER IS 'The user who created the row';
COMMENT ON COLUMN INBOUND_ULD_DESTS.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN INBOUND_ULD_DESTS.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN INBOUND_ULD_DESTS.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN INBOUND_ULD_DESTS.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN INBOUND_ULD_DESTS.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
