/* $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_actions_v
  AS
  SELECT xca.action_id
  ,      xca.action_code
  ,      CASE WHEN  xca.action_code = 'D'
              THEN  'Data Entered'
              WHEN  xca.action_code = 'S'
              THEN  'Submitted For Approval'
              WHEN  xca.action_code = 'P'
              THEN  'Sent for Approval'
              WHEN  xca.action_code = 'I'
              THEN  'Interim Approved'
              WHEN  xca.action_code = 'R'
              THEN  'Returned For Correction'
              WHEN  xca.action_code = 'N'
              THEN  'Reassigned'
              WHEN  xca.action_code = 'A'
              THEN  'Approved'
              WHEN  xca.action_code = 'T'
              THEN  'Transferred'
              WHEN  xca.action_code = '-'
              THEN  'Deleted'
         END action       
  ,      xca.action_timestamp
  ,      xca.action_details
  ,      xca.actioned_by_user_id
  FROM   xxas_com_actions xca;

COMMIT;
EXIT;
