/*****************************************************************************
*
* Filename         - $Workfile:   error_msg.sql  $
*
*                     Name              Date      Version     CR Number
* Author           - See revision history below.
* Last Update      - See revision history below.
*
* Project Name     - TAGTRAK(Oracle Database)
*
* Source Code
* Identifier       - 0/3/300/8010/112
*
* Design Spec
* Section          -
*
* Contents         - Live Schema: Bag table and associated items
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/

PROMPT Creating table ERROR_MSG

create table error_msg(
   agent_code                    char(6),
   type                          char(10),
   msg1                          char(18),
   msg2                          char(18),
   msg3                          char(18),
   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 error_msg add ( constraint error_msg_pk primary key (appn_row_id) using index tablespace &1._indexes);

COMMENT ON TABLE ERROR_MSG IS 'This table contains error messages associated with agents';

COMMENT ON COLUMN ERROR_MSG.AGENT_CODE IS  'Agent code';
COMMENT ON COLUMN ERROR_MSG.MSG1 IS  'First message';
COMMENT ON COLUMN ERROR_MSG.MSG2 IS  'Second message';
COMMENT ON COLUMN ERROR_MSG.MSG3 IS  'Third message';
COMMENT ON COLUMN ERROR_MSG.TYPE IS  'Message type';
COMMENT ON COLUMN ERROR_MSG.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN ERROR_MSG.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN ERROR_MSG.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN ERROR_MSG.CUSER IS 'The user who created the row';
COMMENT ON COLUMN ERROR_MSG.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN ERROR_MSG.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN ERROR_MSG.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN ERROR_MSG.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN ERROR_MSG.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
