Skip to main content

Do you know how to fetch Oracle Cloud Benefits Enrollment Data using SQL?

In this session, we are going to see how to fetch the Oracle Cloud Benefits Enrollment Data using SQL
 
SQL Text:
select papf.person_number "EmplId" ,ppnf.display_name "EmplName" ,to_char(pp.date_of_birth,'mm/dd/yyyy') "DoB" ,pplf.sex "EmplGender" ,pl.name "PlanName" ,opt.name "OptionName" ,pdpnf.display_name "DepName" ,ppdlf.sex "DepGender" ,to_char(ppd.date_of_birth,'mm/dd/yyyy') "DepDoB" ,per_extract_utility.get_decoded_lookup('ORA_PER_CONTACT',pdp.rlnshp_cd) "DepRel" from per_all_people_f papf ,per_all_assignments_f paam ,ben_prtt_enrt_rslt pen ,ben_ler_f ler ,ben_per_in_ler pil ,ben_pl_f pl ,ben_pl_typ_f ptp ,ben_pgm_f pgm ,ben_oipl_f oipl ,ben_opt_f opt ,ben_benefit_relations_f brn ,per_persons pp ,per_person_names_f ppnf ,per_assignment_status_types_vl pastvl ,per_periods_of_service ppos ,ben_elig_cvrd_dpnt pdp ,per_person_names_f pdpnf ,per_persons ppd ,per_people_legislative_f pplf ,per_people_legislative_f ppdlf where 1 = 1 and pen.prtt_enrt_rslt_stat_cd is null and pil.ler_id = ler.ler_id and case when pen.ended_per_in_ler_id is not null then pen.ended_per_in_ler_id else PEN.per_in_ler_id end = pil.per_in_ler_id and pil.per_in_ler_stat_cd in ('STRTD', 'PROCD') and pen.benefit_relation_id = brn.benefit_relation_id and pen.business_group_id = paam.business_group_id and brn.rel_prmry_asg_id = paam.assignment_id and paam.person_id = pen.person_id and paam.person_id = papf.person_id and paam.legislation_code = 'US' and pen.pgm_id = pgm.pgm_id(+) and pen.pl_id = pl.pl_id (+) and pen.pl_typ_id = ptp.pl_typ_id (+) and pen.oipl_id = oipl.oipl_id(+) and pen.opt_id = opt.opt_id(+) and pp.person_id (+) = papf.person_id and ppnf.person_id = papf.person_id and ppnf.name_type = 'GLOBAL' and pastvl.assignment_status_type_id = paam.assignment_status_type_id and ppos.period_of_service_id = paam.period_of_service_id and pdp.prtt_enrt_rslt_id(+) = pen.prtt_enrt_rslt_id and case when pdp.cvg_strt_dt is not null then pdp.cvg_strt_dt else sysdate end <= case when pdp.cvg_thru_dt is not null then pdp.cvg_thru_dt else sysdate end and pdpnf.person_id(+) = pdp.dpnt_person_id and pdpnf.name_type(+) = 'GLOBAL' and ppd.person_id (+) = pdpnf.person_id and pplf.person_id (+) = paam.person_id and pplf.legislation_code (+) = paam.legislation_code and ppdlf.person_id (+) = pdp.dpnt_person_id and ppdlf.legislation_code (+) = paam.legislation_code and opt.name not like '%Waive%' and pen.sspndd_flag = 'N' and pen.enrt_cvg_strt_dt <= pen.enrt_cvg_thru_dt and sysdate between pen.enrt_cvg_strt_dt and pen.enrt_cvg_thru_dt and pen.enrt_cvg_strt_dt between paam.effective_start_date and paam.effective_end_date and pen.enrt_cvg_strt_dt between papf.effective_start_date and papf.effective_end_date and pen.enrt_cvg_strt_dt between ler.effective_start_date and ler.effective_end_date and pen.enrt_cvg_strt_dt between brn.effective_start_date and brn.effective_end_date and pen.enrt_cvg_strt_dt between pgm.effective_start_date(+) and pgm.effective_end_date(+) and pen.enrt_cvg_strt_dt between pl.effective_start_date(+) and pl.effective_end_date(+) and pen.enrt_cvg_strt_dt between oipl.effective_start_date(+) and oipl.effective_end_date(+) and pen.enrt_cvg_strt_dt between opt.effective_start_date(+) and opt.effective_end_date(+) and pen.enrt_cvg_strt_dt between ptp.effective_start_date(+) and ptp.effective_end_date(+) and pen.enrt_cvg_strt_dt between ppnf.effective_start_date and ppnf.effective_end_date and pen.enrt_cvg_strt_dt between pplf.effective_start_date(+) and pplf.effective_end_date(+) and pdp.cvg_strt_dt between ppdlf.effective_start_date(+) and ppdlf.effective_end_date(+) and pdp.cvg_strt_dt between pdpnf.effective_start_date(+) and pdpnf.effective_end_date(+) and sysdate between pdp.cvg_strt_dt(+) and pdp.cvg_thru_dt(+)

Comments

Popular posts from this blog

Do you know how to cancel the Work Relationship using HDL in Oracle Cloud HCM?

In this blog, we are going to see how to cancel the Work Relationship using HDL (HCM Data Loader) Please make sure you have taken the back up of all the necessary data before cancelling the Work Relationship To cancel the Work Relationship, we use HDL Source Key method. Use the below sample template for reference SET PURGE_FUTURE_CHANGES N METADATA|WorkRelationship|SourceSystemOwner|SourceSystemId|PersonId(SourceSystemId)|LegalEmployerName|PersonNumber|DateStart|WorkerType|CancelWorkRelationshipFlag DELETE|WorkRelationship|FUSION|1234|WRK_1234|Legal_Employer|1234|2018/02/01|E|Y In the above template, we do not know the values of the source keys SourceSystemOwner SourceSystemId PersonId(SourceSystemId) Use below query to fetch the SourceSystemOwner Query: select source_system_owner from hrc_integration_key_map where surrogate_id = period_of_service_id   -- pass period_of_service_id corresponding to Work Relationship Use below query to fetch the SourceSy...

Do you know how to generate output using eText Template in Oracle Cloud BI Publisher?

In this blog, we are going to see how to generate output using eText Template in Fusion BI Publisher I am going to show this using sample data. This is my sample data Click "Export" button to download the XML file. This is my XML File Open a blank Word Document and save it as type "Rich Text Format" Add a format setup which is given below <TEMPLATE TYPE> FIXED_POSITION_BASED <OUTPUT CHARACTER SET> UTF-8 <NEW RECORD CHARACTER> Carriage Return Add a Header table which is given below. For headers, give the header name within quotes ex: 'Emplid'. For headers, use the level DATA_DS which is the top level and appears only once in the XML <LEVEL> DATA_DS <POSITION> <LENGTH> <FORMAT> <PAD> <DATA> <COMMENTS> <NEW RECORD> DATA_DS Alpha ‘Emplid’ ...

Do you know how to fetch Oracle Cloud HCM Performance Questionnaire data using SQL

In this session, we are going to see how to how to fetch Oracle Cloud HCM Performance Questionnaire data using SQL SQL Text: with response_view as ( select ep . evaluation_id , ep . person_id , ep . role_type_code , pq . qstnr_question_id , pq . question_type , pq . question_text question , coalesce ( qr . answer_text , qa . long_text ) answer from hra_eval_participants ep , hrq_qstnr_participants qp , hrq_eval_ptcpnt_questions_v epq , hrq_ptcpnt_questions_v pq , hrq_qstnr_latest_resps_v qnlr , hrq_qstn_responses qr , hrq_all_qstn_answers_v qa where 1 = 1 and qp . participant_id = to_char ( ep . eval_participant_id ) and epq . participant_id = qp . participant_id and epq . subject_id = qp . subject_id and pq . qstnr_section_id = epq . qstnr_section_id and pq . qstnr_question_id = epq . qstnr_question_id and qnlr . subject_id = to_char...