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

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

  CREATE OR REPLACE FORCE VIEW xxas_tcm_log_entry_approvers_v
  AS
  SELECT xtles.log_entry_id
  ,      xtles.assignment_id
  ,      xtles.person_id
  ,      xtles.start_date_time
  ,      xtles.end_date_time
  ,      xtles.element_type_id
  ,      xtles.duration_hours
  ,      xtles.field1
  ,      xtles.field2
  ,      xtles.field3
  ,      xtles.field4
  ,      xtles.field5
  ,      xtles.cost_allocation_keyflex_id
  ,      xtles.override_approver_role
  ,      xtles.log_entry_details
  ,      xtles.period_id
  ,      xtles.period_name
  ,      xtles.period_start_date
  ,      xtles.period_end_date
  ,      xtles.period_late_start
  ,      xtles.period_early_finish     
  ,      xtles.current_state_code   
  ,      xtles.current_state
  ,      xtles.current_ins_upd_del
  ,      xtles.internal_data_id  
  ,      xtles.data_id
  ,      xtles.data_type
  ,      xtles.comments
  ,      xtles.log_entry_last_updated_by
  ,      xcdaa.transaction_id    current_transaction_id  
  ,      xcdaa.approver_role     current_approver_role
  FROM   xxas_tcm_log_entry_states_v     xtles
  ,      xxas_com_data_ame_approvers_v  xcdaa 
  WHERE  xtles.internal_data_id = xcdaa.internal_data_id(+);

COMMIT;
EXIT;
