/*****************************************************************************
*
* Filename         - $Workfile:   mws_search_plans.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: mws_search_plans table and associated items
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   mws_search_plans.sql  $  $Revision:   1.3  $
*
* Revision History
*
* Note that user tagtrak is many users. For these users the user
* name is entered as the last line in the change description.
*
* $Log:   /pvcsarch/db_ora/db/source/live/tables/mws_search_plans.svl  $
 * 
 *    Rev 1.3   21 Jun 2001 14:48:06   tagtrak
 * OR:
 * CR:
 * Re-baseline version 4.0.0 to include patches.
 * 
 *    Rev 1.2   02 Apr 1998 19:43:32   tagtrak
 * OR:
 * CR:
 * REV:
 * Initial Issue
 * See label for concession
 * 
 *    Rev 1.1   26 Feb 1998 11:08:14   tagtrak
 * OR:
 * CR:
 * REV:
 * Initial core product version
 * 
 *    Rev 1.0   22 Oct 1997 11:08:10   tagtrak
 * OR:
 * CR:
 * REV:
 * Initial check-in
*
****************************************************************************/

PROMPT Creating table MWS_SEARCH_PLANS

create table MWS_SEARCH_PLANS (
   SCREEN_NAME                   char(12) NOT NULL,
   SEARCH_NAME                   char(12) NOT NULL,
   SORT_COL                      char(12) NOT NULL,
   SORT_ORDER                    char(3) NOT NULL,
   ITEM1                         char(10) NULL,
   ITEM2                         char(10) NULL,
   ITEM3                         char(10) NULL,
   ITEM4                         char(10) NULL,
   ITEM5                         char(10) NULL,
   ITEM6                         char(10) NULL,
   ITEM7                         char(10) NULL,
   ITEM8                         char(10) NULL,
   ITEM9                         char(10) NULL,
   ITEM10                        char(10) NULL,
   ERROR_DESCRIPTION             varchar2(50) NULL,
   LOCATION_DESCRIPTION          varchar2(50) NULL,
   ITEM11                        char(10) NULL,
   ITEM12                        char(10) NULL,
   ITEM13                        char(10) NULL,
   ITEM14                        char(10) NULL,
   ITEM15                        char(10) NULL,
   ARCHIVE_FLAG                  number(10) default 0 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 mws_search_plans add ( constraint mws_search_plans_pk primary key (appn_row_id) using index tablespace &1._indexes);

alter table MWS_SEARCH_PLANS add ( constraint mws_search_plans_uk1 unique (SCREEN_NAME,SEARCH_NAME) using index tablespace &1._indexes);

COMMENT ON TABLE MWS_SEARCH_PLANS IS 'This table contains details of search plans used by the MWS ';

COMMENT ON COLUMN MWS_SEARCH_PLANS.ARCHIVE_FLAG IS  'This field is not used';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ERROR_DESCRIPTION IS  'Description of any errors';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM1 IS  'Item 1';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM10 IS  'Item 1';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM11 IS  'Item 11';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM12 IS  'Item 12';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM13 IS  'Item 13';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM14 IS  'Item 14';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM15 IS  'Item 15';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM2 IS  'Item 2';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM3 IS  'Item 3';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM4 IS  'Item 4';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM5 IS  'Item 5';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM6 IS  'Item 6';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM7 IS  'Item 7';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM8 IS  'Item 8';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ITEM9 IS  'Item 9';
COMMENT ON COLUMN MWS_SEARCH_PLANS.LOCATION_DESCRIPTION IS  'Location description';
COMMENT ON COLUMN MWS_SEARCH_PLANS.SCREEN_NAME IS  'MWS Screen name';
COMMENT ON COLUMN MWS_SEARCH_PLANS.SEARCH_NAME IS  'The name of the search plan';
COMMENT ON COLUMN MWS_SEARCH_PLANS.SORT_COL IS  'Column to sort on';
COMMENT ON COLUMN MWS_SEARCH_PLANS.SORT_ORDER IS  'Sort order (ascending or descending)';
COMMENT ON COLUMN MWS_SEARCH_PLANS.APPN_ROW_ID IS 'Unique sequence number for this row';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ROW_CREATE_TIME IS 'The time the row was created';
COMMENT ON COLUMN MWS_SEARCH_PLANS.ROW_DATE_TIME IS 'The time the row was last modified';
COMMENT ON COLUMN MWS_SEARCH_PLANS.CUSER IS 'The user who created the row';
COMMENT ON COLUMN MWS_SEARCH_PLANS.MUSER IS 'The user who last modified the row';
COMMENT ON COLUMN MWS_SEARCH_PLANS.MTERM IS 'The terminal from which the last modifcation to this row was made';
COMMENT ON COLUMN MWS_SEARCH_PLANS.SYSTEM_ID IS 'The system identifier';
COMMENT ON COLUMN MWS_SEARCH_PLANS.SOURCE IS 'The process that last amended this row ';
COMMENT ON COLUMN MWS_SEARCH_PLANS.TO_BE_ARCHIVED IS 'Indicates that this row is to be archived or has been archived';
