/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2016 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 VIEW xxas_licensed_users_v
AS
SELECT p.prod_key
      ,xxas_util_pkg.decode_lookup
         ('XXAS_PRODUCTS', p.prod_key) product_name
      ,l.column_value user_id
      ,u.user_name
      ,u.start_date user_start_date
      ,u.end_date user_end_date
FROM   xxas_com_products p
      ,TABLE(xxas_act_pkg.licensed_users(p.prod_key)) l
      ,fnd_user u
WHERE  l.column_value = u.user_id(+);

COMMIT;
EXIT;

