/*****************************************************************************
*
* Filename         - $Workfile:   pax_match_rules_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         -  Live Schema: triggers for pax_match_rules table
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 2006
*
*****************************************************************************/
CREATE OR REPLACE TRIGGER tiu_pax_match_rules
BEFORE INSERT OR UPDATE ON pax_match_rules
FOR EACH ROW
DECLARE

  l_supported BOOLEAN := TRUE;

BEGIN

  -- Check that the table / column combination is supported
  l_supported := pax_match.validate_column(:NEW.table_name, :NEW.column_name);

  IF (l_supported = FALSE) THEN

    RAISE_APPLICATION_ERROR(-20790, 'Table / Column ' || :NEW.table_name || '.' || :NEW.column_name || ' not supported for pax matching');

  END IF;

END;
/



