In this session we are going to see how to fetch Oracle Cloud Talent Review Meeting Score using SQL.
SQL Text:
with meeting_review_tbl_vw1 as (
select hd.person_id
,hm.meeting_id
,max(to_number(to_char(hm.meeting_date,'yyyymmdd'))) max_meeting_date
from hrr_dashboards hd
,hrr_meetings hm
where 1 = 1
and hm.meeting_id = hd.meeting_id
group by hd.person_id
,hm.meeting_id
)
,meeting_review_tbl_vw2 as (
select hd.person_id
,perf.rating_description performance
,pot.rating_description potential
,tal.rating_description talent_score
,risk.rating_description risk_of_loss
,impact.rating_description impact_of_loss
from hrr_dashboards hd
,meeting_review_tbl_vw1 mrtv
,hrt_rating_levels_vl pot
,hrt_rating_levels_vl perf
,hrt_rating_levels_vl tal
,hrt_rating_levels_vl risk
,hrt_rating_levels_vl impact
where 1 = 1
and mrtv.person_id = hd.person_id
and mrtv.meeting_id = hd.meeting_id
and pot.rating_level_id(+) = hd.pot_calib_rt_lvl_id
and perf.rating_level_id(+) = hd.perf_calib_rt_lvl_id
and tal.rating_level_id(+) = hd.talent_scor_calb_rt_lvl_id
and risk.rating_level_id(+) = hd.risk_loss_calib_rt_lvl_id
and impact.rating_level_id(+) = hd.impact_loss_calb_rt_lvl_id
)
select ppnf.display_name person_name
,papf.person_number
,ppnf_mgr.display_name manager_name
,dep.name department_name
,job.job_code
,job.name job_name
,loc.location_name
,mrtv2.performance
,mrtv2.potential
,mrtv2.talent_score
,mrtv2.risk_of_loss
,mrtv2.impact_of_loss
,pea.email_address team_member_email
,pea_mgr.email_address manager_email
from per_all_people_f papf
,per_all_assignments_m paam
,hr_organization_v dep
,per_jobs_f_vl job
,hr_locations_all_f_vl loc
,per_person_names_f ppnf
,per_email_addresses pea
,per_assignment_supervisors_f pasf
,per_person_names_f ppnf_mgr
,per_email_addresses pea_mgr
,meeting_review_tbl_vw2 mrtv2
where 1 = 1
and paam.person_id = papf.person_id
and paam.assignment_type in ('E')
and paam.assignment_status_type in ('ACTIVE')
and dep.organization_id(+) = paam.organization_id
and dep.classification_code(+) = 'DEPARTMENT'
and dep.status(+) = 'A'
and job.job_id(+) = paam.job_id
and job.active_status(+) = 'A'
and loc.location_id(+) = paam.location_id
and loc.active_status(+) = 'A'
and ppnf.person_id = paam.person_id
and ppnf.name_type = 'GLOBAL'
and pea.person_id(+) = paam.person_id
and pea.email_type(+) = 'W1'
and pasf.assignment_id(+) = paam.assignment_id
and pasf.manager_type(+) = 'LINE_MANAGER'
and ppnf_mgr.person_id(+) = pasf.manager_id
and ppnf_mgr.name_type(+) = 'GLOBAL'
and pea_mgr.person_id(+) = pasf.manager_id
and pea_mgr.email_type(+) = 'W1'
and mrtv2.person_id = paam.person_id
and :p_eff_dt between papf.effective_start_date and papf.effective_end_date
and :p_eff_dt between paam.effective_start_date and paam.effective_end_date
and paam.effective_start_date between dep.effective_start_date(+) and dep.effective_end_date(+)
and paam.effective_start_date between job.effective_start_date(+) and job.effective_end_date(+)
and paam.effective_start_date between loc.effective_start_date(+) and loc.effective_end_date(+)
and :p_eff_dt between ppnf.effective_start_date and ppnf.effective_end_date
and :p_eff_dt between pea.date_from(+) and coalesce(pea.date_to(+),to_date('4712-12-31'))
and paam.effective_start_date between pasf.effective_start_date(+) and pasf.effective_end_date(+)
and (coalesce(:p_dep,null) is null or paam.organization_id in (:p_dep))
Comments
Post a Comment