PROMPT Creating table SYS_INTERFACE

create table sys_interface (
   id                            number not null,
   name                          varchar2(20),
   description                   varchar2(50),
   status                        varchar2(30),
   last_message_in               DATE,
   last_message_out              DATE,
   subsys_id                     number(2),
   system_type                   varchar2(15),
   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 sys_interface add ( constraint sys_interface_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table sys_interface add ( constraint sys_interface_uk1 unique (id) using index tablespace &1._indexes );

COMMENT ON TABLE SYS_INTERFACE IS 'This table contains details about the interfaces to the system';

COMMENT ON COLUMN SYS_INTERFACE.DESCRIPTION IS  'Interface description';
COMMENT ON COLUMN SYS_INTERFACE.ID IS  'Interface identifier';
COMMENT ON COLUMN SYS_INTERFACE.LAST_MESSAGE_IN IS  'Date of the last message received';
COMMENT ON COLUMN SYS_INTERFACE.LAST_MESSAGE_OUT IS  'Date of the last message sent';
COMMENT ON COLUMN SYS_INTERFACE.NAME IS  'Name of the interface';
COMMENT ON COLUMN SYS_INTERFACE.STATUS IS  'Interface status';
COMMENT ON COLUMN SYS_INTERFACE.SUBSYS_ID IS  'HANS subsystem number';
COMMENT ON COLUMN SYS_INTERFACE.SYSTEM_TYPE IS  'Interface type';
COMMENT ON COLUMN SYS_INTERFACE.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN SYS_INTERFACE.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN SYS_INTERFACE.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN SYS_INTERFACE.CUSER IS 'The user who created the row';
COMMENT ON COLUMN SYS_INTERFACE.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN SYS_INTERFACE.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN SYS_INTERFACE.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN SYS_INTERFACE.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN SYS_INTERFACE.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
