/* $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_data_objects_v
AS
SELECT fov.object_id
      ,fov.obj_name
      --,fov.database_object_name
      ,(select id from xxas_database_objects_v where code = fov.database_object_name) database_object_name
      ,fov.application_id
      ,fov.display_name
      ,fov.pk1_column_name
      ,fov.pk2_column_name
      ,fov.pk3_column_name
      ,fov.pk4_column_name
      ,fov.pk5_column_name
      ,fov.pk1_column_type
      ,fov.pk2_column_type
      ,fov.pk3_column_type
      ,fov.pk4_column_type
      ,fov.pk5_column_type
      ,fov.description
      ,xxas_data_objects_pkg.view_sql(fov.database_object_name) view_sql
FROM  fnd_objects_vl fov;

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

COMMIT;
EXIT;

