SELECT DISTINCT pu.username,
NAME.FULL_NAME,
DECODE(name.full_name,NULL,'Consultant','Employee') user_type,
prdv.role_name,
TO_CHAR(TRUNC(pur.start_date),'MM/DD/YYYY') "role_start_date"
FROM per_user_roles pur,
per_users pu,
per_roles_dn_vl prdv ,
PER_PERSON_NAMES_F NAME
WHERE pur.user_id = pu.user_id
AND pu.person_id = NAME.person_id(+)
AND pur.role_id = prdv.role_id
AND NVL(pu.suspended,'N') = 'N'
AND name.name_type(+) = 'GLOBAL'
and trunc(sysdate) between trunc(name.effective_start_date(+)) and trunc(name.effective_end_date(+))
AND pu.username IN :USER_Name
ORDER BY pu.username,
prdv.role_name
NAME.FULL_NAME,
DECODE(name.full_name,NULL,'Consultant','Employee') user_type,
prdv.role_name,
TO_CHAR(TRUNC(pur.start_date),'MM/DD/YYYY') "role_start_date"
FROM per_user_roles pur,
per_users pu,
per_roles_dn_vl prdv ,
PER_PERSON_NAMES_F NAME
WHERE pur.user_id = pu.user_id
AND pu.person_id = NAME.person_id(+)
AND pur.role_id = prdv.role_id
AND NVL(pu.suspended,'N') = 'N'
AND name.name_type(+) = 'GLOBAL'
and trunc(sysdate) between trunc(name.effective_start_date(+)) and trunc(name.effective_end_date(+))
AND pu.username IN :USER_Name
ORDER BY pu.username,
prdv.role_name
This comment has been removed by a blog administrator.
ReplyDelete