/*****************************************************************************
*
* Filename         - $Workfile : site_info_triggers.sql $
*
* Project Name     - ULTRATRAK(Oracle Database)
*
* Source Code
* Identifier       - FAS/FARFL
*
* Description      - Change to Site_info so that it stores all airports
*
* Language         - SQL Script
*
* File History     - For the development history run the Show History report in PVCS
*
* Coptright Ultra Electronics Airport Systems 2004
*
*****************************************************************************/
/****************************************************************************
* Trigger          ti_site_info
*
* Description:     Insert trigger on the site_info table to auto generate the site_id.
*
* CA History
* Date      Name              CA Number               CA Description
* 07/04/04  Jacqui Bruce      FALCP/CA/461       Initial development of the re-flighting module.
*
*****************************************************************************/

CREATE OR REPLACE TRIGGER ti_site_info
BEFORE INSERT ON site_info
FOR EACH ROW
DECLARE
BEGIN
   SELECT site_info_seq.nextval 
   INTO :new.site_id 
   FROM dual;
EXCEPTION
WHEN OTHERS
THEN
   RAISE;
END;
/

