/* $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_com_data_actions_v
  AS
  SELECT xca.action_id
  ,      xca.action_code
  ,      xca.action
  ,      xca.action_timestamp
  ,      xca.action_details
  ,      xca.actioned_by_user_id
  ,      xcd.internal_data_id
  ,      xcd.data_id
  ,      xcd.data_type
  ,      xcd.current_state_code
  ,      xcd.current_state
  ,      xcd.current_ins_upd_del
  ,      xcd.comments
  ,      xcda.data_action_details
  FROM   xxas_com_actions_v    xca
  ,      xxas_com_data_actions xcda
  ,      xxas_com_data_v       xcd
  WHERE  xca.action_id         = xcda.action_id
  AND    xcda.internal_data_id = xcd.internal_data_id;

COMMIT;
EXIT;
