miércoles, 8 de abril de 2015

Query para obtener Valores de Perfiles

El siguiente query devuelve los valores colocados de cada Perfil colocados en los diferentes niveles del EBS.

SELECT po.profile_option_name as Perfil,
       po.user_profile_option_name Perfil_usuario,
       decode(to_char(pov.level_id),
              '10001',
              'Sucursal',
              '10002',
              'Aplicacion',
              '10003',
              'Responsabilidad',
              '10005',
              'Servidor',
              '10006',
              'Organizacion',
              '10004',
              'Usuario',
              '???') as nivel,
       decode(to_char(pov.level_id),
              '10001',
              '',
              '10002',
              app.application_short_name,
              '10003',
              rsp.responsibility_key,
              '10005',
              svr.node_name,
              '10006',
              org.name,
              '10004',
              usr.user_name,
              '???') as contexto,
       pov.profile_option_value as valor
  FROM apps.fnd_profile_options_vl    po,
       apps.fnd_profile_option_values pov,
       apps.fnd_user                  usr,
       apps.fnd_application           app,
       apps.fnd_responsibility        rsp,
       apps.fnd_nodes                 svr,
       apps.hr_operating_units        org
 WHERE 1 = 1
   AND pov.application_id = po.application_id
   AND pov.profile_option_id = po.profile_option_id
   AND usr.user_id(+) = pov.level_value
   AND rsp.application_id(+) = pov.level_value_application_id
   AND rsp.responsibility_id(+) = pov.level_value
   AND app.application_id(+) = pov.level_value
   AND svr.node_id(+) = pov.level_value
   and org.organization_id(+) = pov.level_value
   and po.profile_option_name='&profile'

 ORDER BY 1, pov.level_id, 5

No hay comentarios:

Publicar un comentario