/*****************************************************************************
*
* Filename         - $Workfile:   uld_trace_v1.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 uld_trace_v1;

CREATE OR REPLACE FORCE VIEW uld_trace_v1
( uld_no,
  trace_action,
  trace_date,
  trace_time,
  location,
  username,
  agent,
  flight_id,
  flight_no,
  flight_date
)
as
select ut.uld_no uld_no,
       ut.trace_action trace_action,
       ut.uld_trace_time trace_date,
       to_char(ut.uld_trace_time, 'DD-MON-RR hh24:mi:ss') trace_time,
       loc.location_description uld_location,
       tu.loginname username,
       tu.agent_code,
       ut.flight_id,
       ut.flight_no,
       ut.flight_date
  from uld_trace ut,
       location loc,
       tagtrak_users tu
 where ut.uld_location_code = loc.location_code
   and ut.user_id = tu.user_id;
