/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2018 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK

DECLARE
  e_obj_not_exists EXCEPTION;
  PRAGMA EXCEPTION_INIT(e_obj_not_exists, -04043);
BEGIN
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE xxas_tcm_notif_entry_table FORCE';
  EXCEPTION
    WHEN e_obj_not_exists THEN
      NULL;
  END;
  BEGIN
    EXECUTE IMMEDIATE 'DROP TYPE xxas_tcm_notif_entry_type FORCE';
  EXCEPTION
    WHEN e_obj_not_exists THEN
      NULL;
  END;
EXCEPTION
  WHEN e_obj_not_exists THEN
    NULL;
END;
/

CREATE TYPE xxas_tcm_notif_entry_type AS OBJECT
  (log_entry_id                   number
  ,ins_upd_del                    varchar2(1)  
  ,assignment_id                  number
  ,entry_date                     varchar2(100) 
  ,start_time                     varchar2(100)
  ,start_time_prev                varchar2(100)
  ,end_time                       varchar2(100)
  ,end_time_prev                  varchar2(100)
  ,duration_hours                 number 
  ,duration_hours_prev            number 
  ,field1                         varchar2(60)
  ,field1_prev                    varchar2(60)
  ,field2                         varchar2(60)
  ,field2_prev                    varchar2(60)
  ,field3                         varchar2(60)
  ,field3_prev                    varchar2(60)
  ,field4                         varchar2(60)
  ,field4_prev                    varchar2(60)
  ,field5                         varchar2(60)
  ,field5_prev                    varchar2(60)
  ,cost_allocation_keyflex        varchar2(250)
  ,cost_allocation_keyflex_prev   varchar2(250)
  ,comments                       varchar2(4000))
/

CREATE OR REPLACE TYPE xxas_tcm_notif_entry_table IS
TABLE OF xxas_tcm_notif_entry_type
/

COMMIT;
EXIT;
