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

CREATE OR REPLACE VIEW xxas_tcm_pend_entry_state_v
AS
SELECT xtpc.pending_clock_id
  ,      xtpc.assignment_id
  ,      xtpc.person_id
  ,      xtpc.start_date_time
  ,      xtpc.element_type_id
  ,      xtpc.pending_details
  ,      xtpc.created_by
  ,      xtpc.creation_date
  ,      xtpc.last_update_date
  ,      xtpc.last_updated_by
  ,      xtpc.last_update_login
  ,      xtpc.status_code
  ,      xtpc.missed_in_flag
  ,      xtpc.missed_out_flag
  ,      xtpc.reason_for_miss
  ,      xtpc.others_reason_detail
  ,      xtpc.auto_saved_start_time
  ,      xtpc.auto_saved_end_time
  ,      xcd.current_state_code
  ,      xcd.current_state
  ,      xcd.current_ins_upd_del
  ,      xcd.internal_data_id
  ,      xcd.data_id
  ,      xcd.data_type
  ,      xcd.comments
  FROM   xxas_tcm_pending_clocks_v 	xtpc
  ,      xxas_com_data_v xcd
  WHERE  xtpc.pending_clock_id = xcd.data_id
  AND    xcd.data_type = 10;

BEGIN
  xxas_fnd_dictionary_pkg.add_view
   (p_application_short_name => xxas_util_pkg.app
   ,p_view_name              => 'XXAS_TCM_PEND_ENTRY_STATE_V'
   ,p_description            => 'Applaud tcm pending log entry state view');
END;
/

COMMIT;
EXIT;