/*********************************************************************************
*         - $Workfile:   bag_trace_data_v4.sql  $
*
*                     Name: Yomi Kogbe    Date: 03/05/00  Version1.0     CR Number:14954
* 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 View
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/

PROMPT Creating view bag_trace_v4;
CREATE OR REPLACE FORCE VIEW bag_trace_v4
as
select btd.flight_date,
       btd.flight_no,
       decode(trim(db_config.db_value),'Y',btd.action_date,
              btd.bag_trace_date) bag_trace_date,
       decode(trim(db_config.db_value),'Y',btd.action_time,
              btd.bag_trace_time) bag_trace_time,
       btd.trace_action,
       btd.bag_tag,
       btd.location_code,
       btd.error_id,
       btd.flight_id_scan,
       btd.pax_id,
       btd.location_description,
       btd.loginname,
       btd.agent_code,
       btd.error_description,
       btd.airport_code,
       btd.alpha_code,
       btd.uld_no,
       btd.record_id
from bag_trace_data btd, db_config where db_config.db_item='ALLOW_BAG_WITH_NOFLT';

