/*****************************************************************************
*
* Filename         - $Workfile:   hold_v1.sql  $
*
*                     Name               Date      Version     REF
*                     Peter Charalambous 01/03/05  1           FALCP/CA/1196
* Author           - See revision history below.
* Last Update      - See revision history below.
*
* Project Name     - TAGTRAK(Oracle Database)
*
* Source Code
* Identifier       - N/A
*
* Design Spec
* Section          -  FALCP/SS/1104
*
* Contents         - Create Live Schema Views
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 2005
*
*****************************************************************************/
PROMPT Creating view hold_v1

CREATE OR REPLACE FORCE VIEW hold_v1 AS
SELECT flight_id
,DECODE(hold_no
        ,NULL,0
        ,'FBULK     ',1
        ,'MBULK     ',1
        ,'RBULK     ',1
        ,2) AS sort_key ,uld_no
FROM holds, ulds
WHERE hold_no(+) = uld_no;
