/*****************************************************************************
*
* Filename         - $Workfile:   carrier_site_config_v.sql  $
*
*                     Name              Date      Version     CR Number
*                     Martin Helliwell 8/10/3       1.0        
* 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, 2003
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   carrier_site_config_v.sql  $  $Revision:   1.0  $
*
* 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/live/views/carrier_site_config_v.svl
  $
*
*****************************************************************************/

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 *                                                                           *
 * View to select all airline alpha codes for which an agent is contracted   *
 * and which are configured for ULD Positioning                              *
 *                                                                           *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
PROMPT Creating view carrier_site_config_v 

CREATE OR REPLACE FORCE 
VIEW carrier_site_config_v 
(agent_code
,alpha_code
) AS
SELECT a.agent_code
,csc.alpha_code
FROM contracted_agents ca
,agents a
,carrier_site_config csc
WHERE ca.agent_code = a.agent_code
AND a.site_id = csc.site_id
AND ca.airline_alpha_code = csc.alpha_code
AND csc.config_item = 'ULD_VALIDATION'
AND csc.config_value = 'Y'
/
