[Home] [Help]
283: where not exists
284: (select null
285: from per_assignments_f a
286: ,per_contact_relationships c
287: ,per_cobra_cov_enrollments e
288: where a.person_id = P_PERSON_ID
289: and a.assignment_id = e.assignment_id
290: and c.person_id = P_PERSON_ID
291: and c.contact_relationship_id = e.contact_relationship_id);
1351: into l_delete_permitted
1352: from sys.dual
1353: where not exists (
1354: select null
1355: from per_cobra_cov_enrollments c
1356: where exists (
1357: select null
1358: from per_assignments_f a
1359: where a.person_id = P_PERSON_ID
2672: hr_utility.set_location(l_proc, 460);
2673: end if;
2674: --
2675: -- Delete COBRA references and then any contact relationships. COBRA
2676: -- must be deleted first as PER_COBRA_COV_ENROLLMENTS has a
2677: -- contact_relationship_id which may be constrained later.
2678: --
2679: begin
2680: --
2680: --
2681: delete from per_cobra_coverage_benefits c2
2682: where c2.cobra_coverage_enrollment_id in
2683: (select c.cobra_coverage_enrollment_id
2684: from per_cobra_cov_enrollments c
2685: where exists
2686: (select null
2687: from per_assignments_f ass
2688: where ass.assignment_id = c.assignment_id
2704: --
2705: delete from per_cobra_coverage_benefits c2
2706: where c2.cobra_coverage_enrollment_id in
2707: (select c.cobra_coverage_enrollment_id
2708: from per_cobra_cov_enrollments c
2709: ,per_contact_relationships r
2710: where r.contact_person_id = P_PERSON_ID
2711: and c.contact_relationship_id = r.contact_relationship_id
2712: and exists
2731: --
2732: delete from per_cobra_coverage_statuses c2
2733: where c2.cobra_coverage_enrollment_id in
2734: (select c.cobra_coverage_enrollment_id
2735: from per_cobra_cov_enrollments c
2736: where exists
2737: (select null
2738: from per_assignments_f ass
2739: where ass.assignment_id = c.assignment_id
2755: --
2756: delete from per_cobra_coverage_statuses c2
2757: where c2.cobra_coverage_enrollment_id in
2758: (select c.cobra_coverage_enrollment_id
2759: from per_cobra_cov_enrollments c
2760: ,per_contact_relationships r
2761: where r.contact_person_id = P_PERSON_ID
2762: and c.contact_relationship_id = r.contact_relationship_id
2763: and exists
2782: --
2783: delete from per_sched_cobra_payments c2
2784: where c2.cobra_coverage_enrollment_id in
2785: (select c.cobra_coverage_enrollment_id
2786: from per_cobra_cov_enrollments c
2787: where exists
2788: (select null
2789: from per_assignments_f ass
2790: where ass.assignment_id = c.assignment_id
2806: --
2807: delete from per_sched_cobra_payments c2
2808: where c2.cobra_coverage_enrollment_id in
2809: (select c.cobra_coverage_enrollment_id
2810: from per_cobra_cov_enrollments c
2811: ,per_contact_relationships r
2812: where r.contact_person_id = P_PERSON_ID
2813: and c.contact_relationship_id = r.contact_relationship_id
2814: and exists
2830: end if;
2831: --
2832: begin
2833: --
2834: delete from per_cobra_cov_enrollments c
2835: where c.assignment_id in
2836: (select ass.assignment_id
2837: from per_assignments_f ass
2838: where ass.person_id = P_PERSON_ID);
2849: end if;
2850: --
2851: begin
2852: --
2853: delete from per_cobra_cov_enrollments c
2854: where exists
2855: (select null
2856: from per_contact_relationships r
2857: where r.contact_person_id = P_PERSON_ID