/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2015 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_database_objects_v
AS
SELECT * FROM (SELECT  t.table_name AS code, t.table_id AS id, 
	t.description, t.application_id, a.application_name, 'TABLE' object_type
  FROM fnd_tables t, fnd_application_vl a
  WHERE t.application_id = a.application_id
UNION
SELECT  v.view_name AS code, v.view_id AS id, 
	v.description, v.application_id, a.application_name,'VIEW' object_type
  FROM fnd_views v, fnd_application_vl a
  WHERE v.application_id = a.application_id) QRSLT;

BEGIN
  xxas_fnd_dictionary_pkg.add_view
   (p_application_short_name => xxas_util_pkg.app
   ,p_view_name              => 'XXAS_DATABASE_OBJECTS_V'
   ,p_description            => 'Applaud Database Objects View');
END;
/

COMMIT;
EXIT;

