/*****************************************************************************
*
* Filename         - $Workfile:   pax_triggers.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 triggers for pax table. 
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/
/****************************************************************************
* @(#)$Workfile:   pax_triggers.sql  $  $Revision:   1.6  $
*
* 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/triggers/pax_triggers.sqv  $
* 
*    Rev 1.6   08 Apr 1999 15:20:22   tagtrak
* OR: 13206
* CR:  
* REV:
* Andrew Walker
* (branch build revision copied to trunk.)
* Neil Bishop
* 
*    Rev 1.5.1.0   25 Feb 1999 15:30:40   tagtrak
* OR: 13206
* CR:  
* REV:
* Andrew Walker
* 
*    Rev 1.5   25 Sep 1998 09:59:30   tagtrak
* OR: 12484
* CR: 12484
* REV:
* Merged Vienna (0.3.1E) and Core Product (0.2.5E) -
* branch ATS revision moved to trunk.
* Andrew Walker
* 
*    Rev 1.4.2.0   18 Aug 1998 09:42:28   tagtrak
* OR: 12484
* CR: 12484
* REV:
* Merging Vienna (0.3.1E) and Core Product (0.2.5E).
* Andrew Walker
* 
*    Rev 1.4.1.0   04 Jun 1998 15:37:52   tagtrak
* OR:
* CR: 12098
* REV:
* Vienna Modifications
* Andrew Walker
* 
*    Rev 1.3   15 Jan 1998 15:10:14   tagtrak
* OR: OR11101, TN13, TN15
* CR:
* REV:
* Phase 2C to Phase 3 upgrade plus code review actions and soome technical issues resolved.
* 
*    Rev 1.2   28 Oct 1997 14:14:20   tagtrak
* Added PVCS header
*
****************************************************************************/

CREATE OR REPLACE TRIGGER tu_pax
BEFORE UPDATE ON pax
BEGIN
   no_archive_modify;
END;
/

CREATE OR REPLACE TRIGGER td_pax
BEFORE DELETE ON pax
FOR EACH ROW
BEGIN

   /* delete all children in "bag" */
   DELETE
     FROM bag
    WHERE pax_id = :old.pax_id;

   /* delete all children in "onward_flight" */
   DELETE
     FROM onward_flight
    WHERE pax_id = :old.pax_id;
    
END;
/
