
/*****************************************************************************
*
* Filename         - $Workfile:   flight_v1.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         - Archive schema view
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   flight_v1.sql  $  $Revision:   1.5  $
*
* 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:   /shared/pvcs/tagtarch/db_ora/db/source/arch/views/flight_v1.sqv  $
* 
*    Rev 1.5   12 Oct 1998 16:41:28   tagtrak
* OR: 12682 12683 12678 12654 12419 12265 12805 12285
* CR: 12682 12683 12678 12654 12419 12265 12805
* REV:
* Vienna enhancements/fixes for database V0.4.1E
* branch ATS revision moved to trunk.
* Andrew Walker
* 
*    Rev 1.4.1.0   25 Sep 1998 12:35:48   tagtrak
* OR: 12682 12683 12678 12654 12419 12265 12285
* CR: 12682 12683 12678 12654 12419 12265
* REV:
* Vienna enhancements for Database 0.4.1
* Andrew Walker
* 
*    Rev 1.3.2.0   18 Aug 1998 09:43:18   tagtrak
* OR: 12484
* CR: 12484
* REV:
* Merging Vienna (0.3.1E) and Core Product (0.2.5E).
* Andrew Walker
* 
*    Rev 1.3.1.0   04 Jun 1998 16:09:40   tagtrak
* OR:
* CR: 12098
* REV:
* Vienna Mods
* 
*    Rev 1.2   28 Oct 1997 14:37:34   tagtrak
* Added PVCS header
*
****************************************************************************/

PROMPT Creating view flight_v1;

CREATE OR REPLACE FORCE VIEW flight_v1 (
	flight_id,
	flight_no,
	flight_date,
  airport_code,
	flight_sch_time,
	flight_est_date,
	flight_status,
	flight_strategy,
	archive_flag,
	departure_time,
  open_count,
  close_count  
) as select
	f.flight_id,
	f.flight_no,
	f.flight_date,
  si.airport_code,
	add_blo_indicator(f.flight_no, f.flight_date, f.flight_sch_time,si.airport_code),
	f.flight_est_date,
	f.flight_status,
	f.flight_strategy,
	f.archive_flag,
	f.departure_time,
  f.open_count,
  f.close_count 
from
	flight_outbound_v1 f, site_info si
where
	op_flight_id is null
  and f.site_id = si.site_id;
