/*****************************************************************************
*
* Filename         - $timed_report_triggers$
*
*                     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         - Triggers for agents table.
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1998
*
*****************************************************************************/

-- File renamed from timed_report_triggers - FALCP/CA/1771 - 8th March 2006

/*
 * Before each insert into the time_report_config table
 * Create a unique sequence number for the id field
 */

create or replace trigger ti_timed_report
before insert on timed_report_config
for each row
declare
begin

        /* Assign the next sequential report id */
        select
                report_id_gen.nextval
        into
                :new.report_id
        from
                dual;

        :new.report_create_date := nvl(:new.report_create_date, sysdate);
end;
/
