Friday, August 31, 2012

Instance Migration Scripts - Profile Options


--  Check Profile Option Values
SELECT DECODE (fpov.level_id,
               10001, 'Site',
               10002, 'Appl',
               10003, 'Resp',
               10004, 'User',
               'Unkown'
              ) "Level",
       DECODE (fpov.level_id,
               10002, fa.application_name,
               10003, fr.responsibility_name,
               10004, fu.user_name,
               '-'
              ) "Location",
       fpov.profile_option_value "Value"
  FROM apps.fnd_profile_option_values fpov,
       apps.fnd_profile_options fpo,
       apps.fnd_profile_options_tl fpot,
       apps.fnd_responsibility_tl fr,
       apps.fnd_user fu,
       apps.fnd_application_tl fa
 WHERE fpov.profile_option_id = fpo.profile_option_id
   AND fpo.profile_option_name = fpot.profile_option_name
   AND fpov.level_value = fr.responsibility_id(+)
   AND fpov.level_value = fu.user_id(+)
   AND fpov.level_value = fa.application_id(+)
   AND fpot.user_profile_option_name = 'XYZ:Billing Term Column';
  
-- Profile Queries
SELECT *
  FROM apps.fnd_profile_options_vl
 WHERE profile_option_name IN
          ('XYZ_OOPS_ERROR_HOLD',
           'XYZ_OOPS_HOLD_COMMENT',
           'XYZ_OOPS_HOLD_REL_REASON',
           'XYZ_OOPS_HOLD_REL_COMMENT'
          )