Here is a breakdown of the query:
SELECT fu.user_name ,
frt.responsibility_name ,
furg.start_date ,
furg.end_date ,
fr.responsibility_key ,
fa.application_short_name
FROM fnd_user_resp_groups_direct furg,
applsys.fnd_responsibility fr,
applsys.fnd_application_tl fat,
applsys.fnd_application fa,
applsys.fnd_user fu,
applsys.fnd_responsibility_tl frt
WHERE furg.user_id = fu.user_id
AND FU.END_DATE is null
AND furg.END_DATE is null
AND furg.responsibility_id = frt.responsibility_id
AND fr.responsibility_id = frt.responsibility_id
AND fa.application_id = fat.application_id
AND fr.application_id = fat.application_id
ORDER BY fu.user_name,frt.responsibility_name;
- The
SELECTclause specifies the columns that will be returned. - The
FROMclause specifies the tables that will be joined. - The
WHEREclause specifies the criteria for selecting the records. - The
ORDER BYclause specifies the order in which the records will be returned.
The fnd_user_resp_groups_direct table stores the relationship between users and responsibility groups. The fnd_responsibility table stores the definition of each responsibility. The fnd_application_tl and fnd_application tables store the translated and untranslated names of each application. The fnd_user table stores the definition of each user. The fnd_responsibility_tl table stores the translated names of each responsibility.
The query joins all of these tables together to get a list of all roles and responsibilities for a given user. The WHERE clause filters the results to only include users who are currently active (i.e., their END_DATE is null). The ORDER BY clause sorts the results by user name and responsibility name.
To use the query, simply replace the fu.user_name filter with the name of the user for whom you want to get the roles and responsibilities. For example, to get the roles and responsibilities for the user john.doe, you would use the following query:
SELECT fu.user_name ,
frt.responsibility_name ,
furg.start_date ,
furg.end_date ,
fr.responsibility_key ,
fa.application_short_name
FROM fnd_user_resp_groups_direct furg,
applsys.fnd_responsibility fr,
applsys.fnd_application_tl fat,
applsys.fnd_application fa,
applsys.fnd_user fu,
applsys.fnd_responsibility_tl frt
WHERE furg.user_id = fu.user_id
AND FU.END_DATE is null
AND furg.END_DATE is null
AND furg.responsibility_id = frt.responsibility_id
AND fr.responsibility_id = frt.responsibility_id
AND fa.application_id = fat.application_id
AND fr.application_id = fat.application_id
AND fu.user_name = 'john.doe'
ORDER BY fu.user_name,frt.responsibility_name;
This query will return a list of all roles and responsibilities for the user john.doe. You can then use this list to generate reports, troubleshoot permissions issues, or simply learn more about the user's access to the system.

0 Comentários