You are on page 1of 1

select pen.* from ben_prtt_enrt_rslt_f pen,ben_elig_cvrd_dpnt_f pdp,per_contact_ relationships pcr where pen.prtt_enrt_rslt_stat_cd is null and pen.prtt_enrt_rslt_id = pdp.

prtt_enrt_rslt_id and pen.pl_id = 1023 --and pen.person_id = 129222 and pdp.dpnt_person_id = pcr.contact_person_id and pcr.contact_type in ('S') and pen.enrt_cvg_thru_dt <= pen.effective_end_date and pen.enrt_cvg_thru_dt = hr_general.end_of_time order by 4; select full_name from per_people_x where person_id = 131380; create or replace function xx_test (p_elig_cvrd_dpnt_id in number ,p_effective_date in date ) return varchar2 is -cursor csr_chk_child_pdp is -select 'Y' from ben_elig_cvrd_dpnt_f pdp, per_contact_relationships pcr where pdp.elig_cvrd_dpnt_id = p_elig_cvrd_dpnt_id and pdp.dpnt_person_id = pcr.contact_person_id and p_effective_date between nvl(pcr.date_start,p_effective_date) and nvl(date_e nd,hr_general.end_of_time) and pcr.contact_type in ('C') and p_effective_date between pdp.cvg_strt_dt and nvl(pdp.cvg_thru_dt,p_effective _date) and (nvl(pdp.cvg_thru_dt,p_effective_date) <= pdp.effective_end_date OR p_effective_date BETWEEN pdp.effective_start_date AND Nvl(pdp.effective_end_d ate,p_effective_date)); -lv_child varchar2(1) := 'N'; -begin -open csr_chk_child_pdp; fetch csr_chk_child_pdp into lv_child; close csr_chk_child_pdp; -return lv_child; -exception -when others then -lv_child := 'N'; return lv_child; --end xx_test;