/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2018 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_DEFAULT_GRANT
AS 
SELECT b.rowid row_id
      ,b.function_id
      ,b.function_name
      ,b.application_id
      ,b.parameters
      ,b.creation_date
      ,b.created_by
      ,b.last_update_date
      ,b.last_updated_by
      ,b.last_update_login
      ,b.type
      ,t.user_function_name
      ,t.description
      ,b.object_id
      ,decode(b.object_id,null,'N','Y') obj_exists_flag
FROM   fnd_form_functions_tl t
      ,fnd_form_functions b
WHERE  b.function_id = t.function_id
AND    t.language    = userenv('LANG');

BEGIN
  xxas_fnd_dictionary_pkg.add_view
   (p_application_short_name => xxas_util_pkg.app
   ,p_view_name              => 'XXAS_DEFAULT_GRANT'
   ,p_description            => 'Applaud Default Data Source Grants');
END;
/
COMMIT;
EXIT;
