
/*****************************************************************************
*
* Filename         - $Workfile:   holding_pens_v2.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       - 
*
* Design Spec
* Section          -
*
* Contents         - Live Schema View
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 2005
*
*****************************************************************************/

PROMPT Creating view     holding_pens_v2;

CREATE OR REPLACE FORCE VIEW   holding_pens_v2
              (
                     group_no,
                     site_id,
                     agent_code,
                     bag_tag,
                     bag_tag1,
                     bag_tag2a,
                     bag_tag2b,
                     bag_tag3
              ) AS
              SELECT
                     bg.group_no,
                     bg.site_id,
                     bg.agent_code,
                     b.bag_tag,
                     b.bag_tag1,
                     b.bag_tag2a,
                     b.bag_tag2b,
                     b.bag_tag3
              FROM
                     bag_group bg,
                     bag       b
              WHERE
                     bg.group_no    = b.group_no
                AND
                     bg.holding_pen = 'Y';


