/*****************************************************************************
*
* Filename         - $Workfile:   crew_bag_v1.sql  $
*
*                   -Name: Yomi Kogbe      Date:29/02/00      Version:1.0     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 View
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/

PROMPT Creating view crew_bag_v1;
CREATE OR REPLACE FORCE VIEW crew_bag_v1
(  bag_tag
 , destination
 , class
 , pax_id
 , load_time
 , location
 , uld_number
 , uld_seq
 ,flight_id
)
as
SELECT b.bag_tag ,
       b.bag_destination ,
       a.pax_class ,
       a.pax_id,
       to_char(b.time_loaded, 'HH24:MI'),
       c.location_description,
       b.uld_no ,
       b.bag_sequence_no ,
       a.flight_id 
 FROM  pax A, bag B, location c
where  b.bag_exception = 'CREW'
  and  b.delete_marker = 0
  AND  b.authority_to_load_dcs = 'Y'
  AND  A.pax_id = B.pax_id
  and  b.location_code = c.location_code;
  

