DBA Data[Home] [Help]

APPS.HR_PERSON_DELETE SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 246

      select    'Y',
        fpi.status
      into    p_yes_no,
        p_status
      from    fnd_product_installations    fpi
      where    fpi.status = 'I'
      and    fpi.application_id =
        (select    fa.application_id
         from    fnd_application        fa
          where    fa.application_short_name = P_APPLICATION_SHORT_NAME
        );
Line: 279

    select    count(*)
    into    v_dummy
    from    per_all_people_f    p
    where    p.person_id    = P_PERSON_ID;
Line: 299

      Purge actions. If there are then raise an error and disallow delete.
  */
  --
  PROCEDURE pay_predel_validation (p_person_id    number)
  IS
  --
  v_delete_permitted    varchar2(1);
Line: 310

    select    'Y'
    into    v_delete_permitted
    from    sys.dual
    where    not exists (
        select    null
              from    pay_assignment_actions    paa,
            per_assignments_f    ass,
            pay_payroll_actions    ppa
        where    paa.assignment_id    = ass.assignment_id
        and    ass.person_id        = P_PERSON_ID
        and    ppa.payroll_action_id    = paa.payroll_action_id
        and    ppa.action_type        <> 'Z');
Line: 348

     ben_person_delete.check_ben_rows_before_delete(p_person_id
                                              ,p_effective_date);
Line: 365

  v_delete_permitted    varchar2(1);
Line: 370

    select 'Y'
    into    v_delete_permitted
    from    sys.dual
    where    not exists (
        select    null
        from    fnd_user    aol
        where     aol.employee_id    = P_PERSON_ID
        );
Line: 399

  v_delete_permitted    varchar2(1);
Line: 402

    select    'Y'
    into    v_delete_permitted
    from    sys.dual
    where    not exists (
        select    null
        from    per_assignments_f        ass,
            hr_assignment_set_amendments    asa
        where    asa.assignment_id    = ass.assignment_id
        and    ass.person_id        = P_PERSON_ID
        and    asa.include_or_exclude    = 'I'
        and    not exists (
            select    null
            from    hr_assignment_set_amendments    asa2
            where    asa2.assignment_set_id    = asa.assignment_set_id
            and    asa2.assignment_id    <> asa.assignment_id)
        );
Line: 431

      Check that for any element entries that are about to be deleted, the
      element type is not closed for the duration of that entry. Also check
      that if the assignment is to a payroll, the payroll period is not closed.
      If any of these 2 checks fail, the delete is disallowed.
  */
  --
  PROCEDURE closed_element_entry_check (p_person_id    IN number,
                    p_session_date    IN date)
  IS
  --
  cursor THIS_PERSONS_ELEMENT_ENTRIES is
    select    l.element_type_id,
        e.effective_start_date,
        e.effective_end_date,
        a.assignment_id
    from    pay_element_entries_f    e,
        per_assignments_f    a,
        pay_element_links_f    l
    where    a.person_id        = P_PERSON_ID
    and    a.assignment_id        = e.assignment_id
    and    e.effective_start_date between
            a.effective_start_date and a.effective_end_date
    and    e.element_link_id    = l.element_link_id
    and    e.effective_start_date between
            l.effective_start_date and l.effective_end_date;
Line: 479

      Searches for any contacts of the person being deleted who have
      COBRA Coverage Enrollments which are as a result of the Persons
      Assignments.
  */
  --
  PROCEDURE contact_cobra_validation (p_person_id    number)
  IS
  --
  v_delete_permitted    varchar2(1);
Line: 492

    select    'Y'
    into    v_delete_permitted
    from    sys.dual
    where    not exists (
        select    null
        from    per_assignments_f a
        ,       per_contact_relationships c
        ,       per_cobra_cov_enrollments e
                where   a.person_id = P_PERSON_ID
        and     a.assignment_id = e.assignment_id
        and     c.person_id = P_PERSON_ID
        and     c.contact_relationship_id = e.contact_relationship_id);
Line: 524

  v_delete_permitted    varchar2(1);
Line: 534

     select   null
     into v_delete_permitted
     from     sys.dual
     where not exists(select   null
                  from     per_contracts_f
                  where    person_id = p_person_id);
Line: 554

      Validates whether a person can be deleted from the HR database.
      This is the weak validation performed prior to delete using the
      Delete Person form.
  */
  --
  PROCEDURE weak_predel_validation (p_person_id        IN number,
                                    p_session_date    IN date,
                                    p_dt_delete_mode    IN varchar2) -- 4169275
  IS
  --
  -- DECLARE THE LOCAL VARIABLES
  --
  v_pay_installed    varchar2(1);
Line: 571

  v_delete_permitted    varchar2(1);
Line: 576

    hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',1);
Line: 578

    hr_person_delete.person_existance_check(P_PERSON_ID);
Line: 580

    hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',2);
Line: 582

    hr_person_delete.product_installed('PAY', v_pay_status,
    v_pay_installed, v_oracle_id);
Line: 585

    hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',4);
Line: 591

    if upper(p_dt_delete_mode) not in ('DELETE_NEXT_CHANGE','FUTURE_CHANGE') then
       hr_person_delete.aol_predel_validation(P_PERSON_ID);
Line: 596

    hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',5);
Line: 598

    hr_person_delete.assignment_set_check(P_PERSON_ID);
Line: 600

    hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',6);
Line: 603

       hr_person_delete.pay_predel_validation(P_PERSON_ID);
Line: 610

       hr_person_delete.ben_predel_validation(P_PERSON_ID,p_session_date);
Line: 612

    hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',8);
Line: 614

    hr_person_delete.closed_element_entry_check(P_PERSON_ID, P_SESSION_DATE);
Line: 616

    hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',9);
Line: 618

    hr_person_delete.contact_cobra_validation(P_PERSON_ID);
Line: 620

    hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',10);
Line: 622

    hr_person_delete.contracts_check(P_PERSON_ID);
Line: 624

    hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',11);
Line: 636

      Moderate pre-delete validation called from the Stong_predel_validation
      procedure and HR API's.

*/
  PROCEDURE moderate_predel_validation (p_person_id IN number,
                                      p_session_date IN date,
                                      p_dt_delete_mode    IN varchar2) -- 4169275

  IS
  v_delete_permitted    varchar2(1);
Line: 651

     SELECT        ext_chg_evt_log_id
     FROM          ben_ext_chg_evt_log
     WHERE         person_id = p_person_id
     FOR UPDATE OF ext_chg_evt_log_id;
Line: 661

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 1);
Line: 663

     hr_person_delete.person_existance_check(P_PERSON_ID);
Line: 665

     hr_person_delete.assignment_set_check(P_PERSON_ID);
Line: 672

     if upper(p_dt_delete_mode) not in ('DELETE_NEXT_CHANGE','FUTURE_CHANGE') then
        hr_person_delete.aol_predel_validation(P_PERSON_ID);
Line: 678

     hr_person_delete.pay_predel_validation(P_PERSON_ID);
Line: 680

     hr_person_delete.ben_predel_validation(P_PERSON_ID,p_session_date);
Line: 682

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 2);
Line: 687

	 -- Select statement modified to improve performance.

          select    'Y'
	          into    v_delete_permitted
	          from    sys.dual
	          where    not exists (
	          select    null
	          from    per_letter_request_lines r
	          where    r.person_id    = P_PERSON_ID
	                  and     r.date_from >= P_SESSION_DATE );
Line: 698

	  select    'Y'
	  into    v_delete_permitted
	  from    sys.dual
	  where    not exists (
	        select    null
	        from    per_letter_request_lines r
	         where exists (
	         	select  null
	                from    per_assignments_f a
	                where   a.person_id     = P_PERSON_ID
	                and     a.effective_start_date >= P_SESSION_DATE
	                and     a.assignment_id = r.assignment_id));
Line: 712

        /* select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_letter_request_lines r
        where    r.person_id    = P_PERSON_ID
                and     r.date_from >= P_SESSION_DATE
                or    exists (
                        select  null
                        from    per_assignments_f a
                        where   a.person_id     = P_PERSON_ID
                        and     a.effective_start_date >= P_SESSION_DATE
                        and     a.assignment_id = r.assignment_id));*/
Line: 734

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 3);
Line: 737

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_contact_relationships r
        where    r.person_id        = P_PERSON_ID
        or    r.contact_person_id    = P_PERSON_ID);
Line: 751

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 5);
Line: 754

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_events e
        where    e.internal_contact_person_id = P_PERSON_ID);
Line: 767

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 6);
Line: 770

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_bookings b
        where    b.person_id         = P_PERSON_ID);
Line: 783

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 7);
Line: 787

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    1 >= (
        select    count(*)
        from    per_assignments_f a
        where    a.person_id         = P_PERSON_ID
                and     a.effective_start_date > P_SESSION_DATE);-- fix for bug 4238025
Line: 801

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 8);
Line: 804

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_assignments_f a
        where    a.recruiter_id        = P_PERSON_ID
        or    a.supervisor_id        = P_PERSON_ID);
Line: 818

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 9);
Line: 821

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_periods_of_service    p
        where    p.termination_accepted_person_id = P_PERSON_ID);
Line: 834

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 10);
Line: 837

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_person_analyses a
        where    a.person_id         = P_PERSON_ID);
Line: 850

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 11);
Line: 853

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_absence_attendances a
        where    a.person_id         = P_PERSON_ID);
Line: 866

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 12);
Line: 869

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_absence_attendances a
        where    a.authorising_person_id        = P_PERSON_ID
        or    a.replacement_person_id        = P_PERSON_ID);
Line: 883

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 13);
Line: 886

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_recruitment_activities r
        where    r.authorising_person_id        = P_PERSON_ID
        or    r.internal_contact_person_id    = P_PERSON_ID);
Line: 900

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION',13);
Line: 902

        select 'Y'
        into    v_delete_permitted
        from    sys.dual
        where   not exists (
                select  null
                from    per_appraisals apr
                where   apr.appraisee_person_id = P_PERSON_ID
                   or   apr.appraiser_person_id = P_PERSON_ID);
Line: 916

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION',13);
Line: 918

        select 'Y'
        into    v_delete_permitted
        from    sys.dual
        where   not exists (
                select  null
                from    per_participants par
                where   par.person_id = P_PERSON_ID);
Line: 931

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 14);
Line: 934

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_requisitions r
        where    r.person_id         = P_PERSON_ID);
Line: 947

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 15);
Line: 950

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_vacancies v
        where    v.recruiter_id         = P_PERSON_ID);
Line: 963

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 16);
Line: 968

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    pay_element_entries_f    e,
            per_assignments_f    a,
            pay_element_links_f    l
        where    a.person_id         = P_PERSON_ID
        and    a.assignment_id        = e.assignment_id
        and    e.element_link_id    = l.element_link_id
        and    l.standard_link_flag    = 'N');
Line: 986

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 17);
Line: 992

        select  'Y'
        into    v_delete_permitted
        from    sys.dual
        where   not exists (
                select  null
                from    pay_element_entries_f   e,
            per_assignments_f       a
        where   a.person_id             = P_PERSON_ID
                and     a.assignment_id         = e.assignment_id
        and    e.entry_type        <> 'E');
Line: 1008

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 171);
Line: 1012

     hr_person_delete.closed_element_entry_check(P_PERSON_ID, P_SESSION_DATE);
Line: 1014

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 18);
Line: 1017

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_assignment_extra_info i
        where    exists (
            select    null
            from    per_assignments_f a
            where    a.person_id    = P_PERSON_ID
            and    a.assignment_id    = i.assignment_id));
Line: 1034

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 19);
Line: 1037

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_secondary_ass_statuses s
        where    exists (
            select    null
            from    per_assignments_f a
            where    a.person_id    = P_PERSON_ID
            and    a.assignment_id    = s.assignment_id));
Line: 1055

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 20);
Line: 1058

         select    'Y'
         into    v_delete_permitted
         from    sys.dual
         where    not exists (
        select    null
        from    per_events    e
        where    exists (
            select    null
            from    per_assignments_f a
            where    a.person_id    = P_PERSON_ID
            and    a.assignment_id    = e.assignment_id));
Line: 1075

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 21);
Line: 1078

        select  'Y'
        into    v_delete_permitted
        from    sys.dual
        where   not exists (
                select  null
        from    per_spinal_point_placements_f    p
        where    exists  (
                        select  null
                        from    per_assignments_f a
                        where   a.person_id     = P_PERSON_ID
                        and     a.assignment_id = p.assignment_id));
Line: 1095

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 22);
Line: 1098

        select  'Y'
        into    v_delete_permitted
        from    sys.dual
        where   not exists (
                select  null
                from    per_quickpaint_result_text t
                where   exists  (
                        select  null
                        from    per_assignments_f a
                        where   a.person_id     = P_PERSON_ID
                        and     a.assignment_id = t.assignment_id));
Line: 1115

     hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 26);
Line: 1118

        select  'Y'
        into    v_delete_permitted
        from    sys.dual
        where   not exists (
                select  null
                from    per_cobra_cov_enrollments c
        where   exists  (
                        select  null
                        from    per_assignments_f a
                        where   a.person_id     = P_PERSON_ID
                        and     a.assignment_id = c.assignment_id));
Line: 1135

    hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 27);
Line: 1137

    hr_person_delete.contact_cobra_validation(P_PERSON_ID);
Line: 1139

    hr_person_delete.contracts_check(P_PERSON_ID);
Line: 1141

    hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 28);
Line: 1152

      DELETE FROM ben_ext_chg_evt_log
      WHERE  CURRENT OF ben_ext_chg_log;
Line: 1158

    ben_person_delete.perform_ri_check(p_person_id);
Line: 1163

  if upper(p_dt_delete_mode) not in ('DELETE_NEXT_CHANGE','FUTURE_CHANGE') then
    per_ota_predel_validation.ota_predel_per_validation(P_PERSON_ID);
Line: 1170

    hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 29);
Line: 1176

    hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 30);
Line: 1182

    hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 31);
Line: 1188

    hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 32);
Line: 1194

    hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 33);
Line: 1200

    hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 34);
Line: 1206

    hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 35);
Line: 1210

    hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 36);
Line: 1227

      If additional data is found then the delete of this person from
      the calling module is invalid as it is beyond its scope. The Delete
      Person form should therefore be used (which only performs
      weak_predel_validation) if a delete really is required.
        p_person_mode  -  'A' check for applicants
                          'E' check for employees
                          'O' check for other types

    NOTE
      No validation is required for security (PER_PERSON_LIST* tables) as
      this is implicit for the person via assignment criteria. The
      rows in these tables can just be deleted.
  */
  PROCEDURE strong_predel_validation (p_person_id    IN number,
                                      p_session_date    IN date,
                                      p_dt_delete_mode    IN varchar2) -- 4169275
  IS
  --
  v_person_types    number;
Line: 1249

     hr_utility.set_location('HR_PERSON_DELETE.STRONG_PREDEL_VALIDATION', 1);
Line: 1255

     select    count(*)
     into    v_person_types
     from    per_people_f p,
                per_person_types ppt
     where      p.person_id     = P_PERSON_ID
     and        p.effective_end_date >= P_SESSION_DATE
     and        p.person_type_id = ppt.person_type_id
     and    exists
        (select    null
         from    per_people_f p2,
            per_person_types ppt2
         where    p2.person_id    = p.person_id
                 and    p2.effective_end_date >= P_SESSION_DATE
         and    p2.person_type_id = ppt2.person_type_id
         and    ppt2.system_person_type <> ppt.system_person_type
        );
Line: 1277

     hr_utility.set_location('HR_PERSON_DELETE.STRONG_PREDEL_VALIDATION', 1);
Line: 1280

    if p_dt_delete_mode = 'ZAP' then
     hr_person_delete.moderate_predel_validation(p_person_id => p_person_id
                                            ,p_session_date =>p_session_date
					    ,p_dt_delete_mode => p_dt_delete_mode -- 4169275
					    );
Line: 1299

      then delete this contact also. Otherwise do nothing.
    NOTES
      p_person_id        non-contact in relationship
      p_contact_person_id    contact in this relationship - the person
                who the check is performed against.
      p_contact_relationship_id relationship which is currently being
                considered for this contact.
  */
  --
  PROCEDURE check_contact (p_person_id        IN number,
               p_contact_person_id    IN number,
               p_contact_relationship_id IN number,
               p_session_date    IN date)
  IS
  --
  v_contact_elsewhere    varchar2(1);
Line: 1316

  v_delete_contact       varchar2(1);
Line: 1320

    hr_utility.set_location('HR_PERSON_DELETE.CHECK_CONTACT', 1);
Line: 1322

    hr_person_delete.person_existance_check(P_CONTACT_PERSON_ID);
Line: 1325

        select    'Y'
        into    v_contact_elsewhere
    from    sys.dual
    where    exists (
        select    null
            from    per_contact_relationships r
            where    r.contact_relationship_id <> P_CONTACT_RELATIONSHIP_ID
        and    r.contact_person_id      = P_CONTACT_PERSON_ID);
Line: 1341

    hr_utility.set_location('HR_PERSON_DELETE.CHECK_CONTACT', 2);
Line: 1344

        select    'Y'
        into    v_other_only
        from    sys.dual
        where    not exists
            (select null
             from    per_people_f p
             where    p.person_id        = P_CONTACT_PERSON_ID
             and    p.current_emp_or_apl_flag    = 'Y');
Line: 1363

        v_delete_contact := 'Y';
Line: 1364

            hr_person_delete.strong_predel_validation(P_CONTACT_PERSON_ID,
                            P_SESSION_DATE);
Line: 1368

            v_delete_contact := 'N';
Line: 1371

        if v_delete_contact = 'Y' then
         hr_person_delete.people_default_deletes(P_CONTACT_PERSON_ID,
                                TRUE);
Line: 1385

      delete_a_person
    DESCRIPTION
      Validates whether a person can be deleted from the HR database.
      It is assumed that weak_predel_validation and the other application
      *_delete_person.*_predel_valdation procedures have been successfully
      completed first.
      Cascades are all performed according to the locking ladder.
    NOTE
      P_FORM_CALL is set to 'Y' if this procedure is called from a forms
      module. In this case, the deletes are performed post-delete and a
      row therefore may not exist in per_people_f (for this person_id).
      For this reason the existance check will be ignored.
  */
  --
  PROCEDURE delete_a_person (p_person_id        IN number,
                 p_form_call        IN boolean,
                 p_session_date        IN date)
  IS
  --
  cursor THIS_PERSONS_CONTACTS is
    select    contact_person_id,
        contact_relationship_id
    from    per_contact_relationships
    where    person_id    = P_PERSON_ID;
Line: 1411

    select    person_id
    from    per_people_f
    where    person_id    = P_PERSON_ID
    FOR    UPDATE;
Line: 1417

    select    assignment_id
    from    per_assignments_f
    where    person_id    = P_PERSON_ID
    FOR    UPDATE;
Line: 1422

  cursor DELETE_COMPONENTS is
        select  pp.pay_proposal_id
        from    per_pay_proposals pp,
                per_assignments_f pa
        where   pa.person_id       = P_PERSON_ID
        and     pa.assignment_id   = pp.assignment_id
        FOR     UPDATE;
Line: 1431

    SELECT medical_assessment_id,
           object_version_number
    FROM   per_medical_Assessments pma
    WHERE  pma.person_id = p_person_id;
Line: 1437

          select incident_id, object_version_number
          from per_work_incidents
          where person_id =  p_person_id;
Line: 1442

          select disability_id, object_version_number, effective_start_date, effective_end_date
          from per_disabilities_f
          where person_id = p_person_id;
Line: 1447

        select role_id, object_version_number
        from per_roles
        where person_id= p_person_id;
Line: 1452

       	select   distinct person_type_usage_id
--		,ptu.effective_start_date
--		,ptu.object_version_number
	from 	per_person_type_usages_f ptu
	where 	ptu.person_id = p_person_id
	order by person_type_usage_id;
Line: 1487

	select distinct assignment_id
	from per_assignments_f
	where person_id = p_person_id;
Line: 1497

        hr_person_delete.person_existance_check(P_PERSON_ID);
Line: 1500

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 0);
Line: 1508

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1);
Line: 1519

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 888);
Line: 1522

    update    per_requisitions r
        set    r.person_id    = null
        where    r.person_id    = P_PERSON_ID;
Line: 1527

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 101);
Line: 1530

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2);
Line: 1536

     delete    from per_letter_request_lines l
        where    l.person_id     = P_PERSON_ID;
Line: 1540

    		delete from per_letter_request_lines l
        	where l.assignment_id = l_assignment_id(i);
Line: 1544

    delete    from per_letter_request_lines l
        where    l.person_id     = P_PERSON_ID
    or    exists (
        select  null
                        from    per_assignments_f a
                        where   a.person_id     = P_PERSON_ID
                        and     a.assignment_id = l.assignment_id);*/
Line: 1553

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 201);
Line: 1560

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3);
Line: 1563

    delete    from per_absence_attendances a
        where    a.person_id    = P_PERSON_ID;
Line: 1567

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 301);
Line: 1570

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4);
Line: 1573

        update    per_absence_attendances a
        set    a.authorising_person_id    = null
    where    a.authorising_person_id = P_PERSON_ID;
Line: 1578

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 401);
Line: 1581

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 5);
Line: 1584

    update    per_absence_attendances a
        set    a.replacement_person_id    = null
        where     a.replacement_person_id = P_PERSON_ID;
Line: 1589

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 501);
Line: 1592

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 6);
Line: 1595

    delete    from per_person_analyses a
        where    a.person_id     = P_PERSON_ID;
Line: 1599

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 601);
Line: 1602

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 8);
Line: 1608

    update    per_periods_of_service p
    set    p.termination_accepted_person_id    = null
    where     p.termination_accepted_person_id    = P_PERSON_ID;
Line: 1613

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 801);
Line: 1616

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 9);
Line: 1619

        update    per_recruitment_activities r
    set    r.authorising_person_id    = null
    where    r.authorising_person_id = P_PERSON_ID;
Line: 1624

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 901);
Line: 1627

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 10);
Line: 1630

        update  per_recruitment_activities r
        set     r.internal_contact_person_id    = null
    where    r.internal_contact_person_id    =  P_PERSON_ID;
Line: 1635

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1001);
Line: 1638

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',11);
Line: 1648

begin -- Delete from HR_QUEST_ANSWER_VALUES
  begin -- Delete from HR_QUEST_ANSWER_VALUES: PARTICIPANTS
     select 1
     into v_dummy
     from sys.dual
     where exists (
	    select null
	      from per_participants par
	     where par.person_id = P_PERSON_ID);
Line: 1661

        delete from hr_quest_answer_values qsv2
         where qsv2.quest_answer_val_id in
       (select qsv.quest_answer_val_id
          from hr_quest_answer_values qsv
              ,hr_quest_answers qsa
              ,per_participants par
          where qsv.questionnaire_answer_id = qsa.questionnaire_answer_id
            and qsa.type_object_id = par.participant_id
            and qsa.type = 'PARTICIPANT'
            and par.person_id = P_PERSON_ID);
Line: 1672

     hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 215); --added for bug 5464252
Line: 1677

      hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 211);
Line: 1679

  end;  -- Delete from HR_QUEST_ANSWER_VALUES: PARTICIPANTS
Line: 1681

  begin -- Delete from HR_QUEST_ANSWER_VALUES: APPRAISALS
     select 2
     into v_dummy
     from sys.dual
     where exists (
	    select null
		  from per_appraisals apr
		 where (apr.appraiser_person_id = P_PERSON_ID
            or  apr.appraisee_person_id = P_PERSON_ID));
Line: 1694

       delete from hr_quest_answer_values qsv2
         where qsv2.quest_answer_val_id in
       (select qsv.quest_answer_val_id
          from hr_quest_answer_values qsv
              ,hr_quest_answers qsa
              ,per_appraisals apr
         where qsv.questionnaire_answer_id = qsa.questionnaire_answer_id
         and   qsa.type_object_id = apr.appraisal_id
         and   qsa.type='APPRAISAL'
         and   (apr.appraisee_person_id = P_PERSON_ID
         or     apr.appraiser_person_id = P_PERSON_ID));
Line: 1710

	     hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 220);
Line: 1712

   end; -- Delete from HR_QUEST_ANSWER_VALUES: APPRAISALS
Line: 1713

end; -- Delete from HR_QUEST_ANSWER_VALUES
Line: 1717

/*        delete from hr_quest_answer_values qsv2
        where qsv2.quest_answer_val_id in (
        select qsv.quest_answer_val_id
          from hr_quest_answer_values qsv
             , hr_quest_answers qsa
             , per_appraisals apr
             , per_participants par
         where qsv.questionnaire_answer_id = qsa.questionnaire_answer_id
           and (qsa.type_object_id = apr.appraisal_id
                    and qsa.type='APPRAISAL'
                    and (apr.appraisee_person_id = P_PERSON_ID
                         or  apr.appraiser_person_id = P_PERSON_ID))
            or (qsa.type_object_id = par.participant_id
                    and qsa.type='PARTICIPANT'
                    and  par.person_id = P_PERSON_ID)
             ); -- Fix 3619599
Line: 1735

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1101);
Line: 1740

        delete from hr_quest_answers qsa2
         where qsa2.questionnaire_answer_id in (
         select qsa.questionnaire_answer_id
           from hr_quest_answers qsa
              , per_participants par
              , per_appraisals apr
          where (qsa.type_object_id = apr.appraisal_id
                      and qsa.type='APPRAISAL'
                     and (apr.appraiser_person_id = P_PERSON_ID
                          or  apr.appraisee_person_id = P_PERSON_ID))
             or (qsa.type_object_id = par.participant_id
                 and qsa.type='PARTICIPANT'
                 and  par.person_id = P_PERSON_ID)
            ); -- Fix 3619599
Line: 1756

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1102);
Line: 1762

    DELETE
    FROM per_participants par2
    WHERE par2.person_id = P_PERSON_ID
    OR
    (
        par2.participation_in_column = 'APPRAISAL_ID'
        AND par2.participation_in_table = 'PER_APPRAISALS'
        AND par2.participation_in_id in
        (
        SELECT
            apr.appraisal_id
        FROM per_appraisals apr
        WHERE
            (
                apr.appraisee_person_id = P_PERSON_ID
                OR apr.appraiser_person_id = P_PERSON_ID
            )
        )
    );
Line: 1783

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1103);
Line: 1789

       delete from per_appraisals apr
        where apr.appraiser_person_id = P_PERSON_ID
           or apr.appraisee_person_id = P_PERSON_ID;
Line: 1794

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1104);
Line: 1797

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 12);
Line: 1799

    hr_security.delete_per_from_list(P_PERSON_ID);
Line: 1801

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 14);
Line: 1804

        update    per_vacancies v
    set    v.recruiter_id    = null
    where    v.recruiter_id    = P_PERSON_ID;
Line: 1809

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1401);
Line: 1812

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 15);
Line: 1815

    update    per_assignments_f ass
        set    ass.person_referred_by_id = null
        where    ass.person_referred_by_id = P_PERSON_ID;
Line: 1820

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1501);
Line: 1823

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 16);
Line: 1826

    update    per_assignments_f a
        set    a.recruiter_id        = null
        where    a.recruiter_id        = P_PERSON_ID;
Line: 1831

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1601);
Line: 1834

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 17);
Line: 1837

    update    per_assignments_f a
        set    a.supervisor_id        = null
        where    a.supervisor_id         = P_PERSON_ID;
Line: 1842

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1701);
Line: 1845

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 18);
Line: 1852

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 185);
Line: 1861

        open DELETE_COMPONENTS;
Line: 1863

           FETCH DELETE_COMPONENTS INTO v_proposal_id;
Line: 1864

           EXIT WHEN DELETE_COMPONENTS%NOTFOUND;
Line: 1865

           DELETE FROM per_pay_proposal_components
              WHERE pay_proposal_id = v_proposal_id;
Line: 1868

        close DELETE_COMPONENTS;
Line: 1872

       delete  from per_pay_proposals p
        where   exists (
                select  null
                from    per_assignments_f ass
                where   ass.assignment_id       = p.assignment_id
                and     ass.person_id           = P_PERSON_ID);
Line: 1880

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1801);
Line: 1883

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 19);
Line: 1886

        delete  from pay_personal_payment_methods_f m
        where   m.assignment_id in (
                select ass.assignment_id
                from   per_assignments_f ass
                where  ass.person_id  = P_PERSON_ID);
Line: 1893

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1901);
Line: 1896

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 20);
Line: 1899

        delete    from per_assignment_budget_values_f a
        where   a.assignment_id in (
        select    ass.assignment_id
        from    per_assignments_f ass
        where   ass.person_id    = P_PERSON_ID);
Line: 1906

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2001);
Line: 1909

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 21);
Line: 1912

        delete    from per_assignment_extra_info a
        where   a.assignment_id in (
        select    ass.assignment_id
        from    per_assignments_f ass
        where    ass.person_id        = P_PERSON_ID);
Line: 1919

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2101);
Line: 1922

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 22);
Line: 1925

        delete    from per_secondary_ass_statuses a
        where   a.assignment_id in (
        select    ass.assignment_id
        from    per_assignments_f ass
        where    ass.person_id        = P_PERSON_ID);
Line: 1932

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2201);
Line: 1935

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23);
Line: 1942

        delete  from per_cobra_coverage_benefits c2
        where   c2.cobra_coverage_enrollment_id in (
        select    c.cobra_coverage_enrollment_id
        from    per_cobra_cov_enrollments c
        where    exists (
            select  null
                        from    per_assignments_f ass
                        where   ass.assignment_id       = c.assignment_id
                        and     ass.person_id           = P_PERSON_ID)
        );
Line: 1954

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2301);
Line: 1957

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 230);
Line: 1960

        delete  from per_cobra_coverage_benefits c2
        where   c2.cobra_coverage_enrollment_id in (
        select    c.cobra_coverage_enrollment_id
        from    per_cobra_cov_enrollments c
        ,       per_contact_relationships r
        where    r.contact_person_id = P_PERSON_ID
        and     c.contact_relationship_id = r.contact_relationship_id
        and     exists (
            select  null
                        from    per_assignments_f ass
                        where   ass.assignment_id       = c.assignment_id
                        and     ass.person_id           = r.person_id)
        );
Line: 1975

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23001);
Line: 1978

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 231);
Line: 1981

        delete  from per_cobra_coverage_statuses c2
        where   c2.cobra_coverage_enrollment_id in (
        select    c.cobra_coverage_enrollment_id
        from    per_cobra_cov_enrollments c
        where    exists (
            select  null
                        from    per_assignments_f ass
                        where   ass.assignment_id       = c.assignment_id
                        and     ass.person_id           = P_PERSON_ID)
        );
Line: 1993

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23101);
Line: 1996

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 232);
Line: 1999

        delete  from per_cobra_coverage_statuses c2
        where   c2.cobra_coverage_enrollment_id in (
        select    c.cobra_coverage_enrollment_id
        from    per_cobra_cov_enrollments c
        ,       per_contact_relationships r
        where    r.contact_person_id = P_PERSON_ID
        and     c.contact_relationship_id = r.contact_relationship_id
        and     exists (
            select  null
                        from    per_assignments_f ass
                        where   ass.assignment_id       = c.assignment_id
                        and     ass.person_id           = r.person_id)
        );
Line: 2014

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23201);
Line: 2017

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 233);
Line: 2020

        delete  from per_sched_cobra_payments c2
        where   c2.cobra_coverage_enrollment_id in (
        select    c.cobra_coverage_enrollment_id
        from    per_cobra_cov_enrollments c
        where    exists (
            select  null
                        from    per_assignments_f ass
                        where   ass.assignment_id       = c.assignment_id
                        and     ass.person_id           = P_PERSON_ID)
        );
Line: 2032

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23301);
Line: 2035

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 234);
Line: 2038

        delete  from per_sched_cobra_payments c2
        where   c2.cobra_coverage_enrollment_id in (
        select    c.cobra_coverage_enrollment_id
        from    per_cobra_cov_enrollments c
        ,       per_contact_relationships r
        where    r.contact_person_id = P_PERSON_ID
        and     c.contact_relationship_id = r.contact_relationship_id
        and     exists (
            select  null
                        from    per_assignments_f ass
                        where   ass.assignment_id       = c.assignment_id
                        and     ass.person_id           = r.person_id)
        );
Line: 2053

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23401);
Line: 2056

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 235);
Line: 2059

        delete  from per_cobra_cov_enrollments c
    where    c.assignment_id in  (
                        select  ass.assignment_id
                        from    per_assignments_f ass
                        where   ass.person_id           = P_PERSON_ID);
Line: 2066

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23501);
Line: 2069

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 236);
Line: 2072

        delete  from per_cobra_cov_enrollments c
    where    exists
           (select null
        from   per_contact_relationships r
        where   r.contact_person_id = P_PERSON_ID
        and     c.contact_relationship_id = r.contact_relationship_id
        and exists (
                        select  null
                        from    per_assignments_f ass
                        where   ass.assignment_id       = c.assignment_id
                        and     ass.person_id           = r.person_id)
               );
Line: 2086

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23601);
Line: 2094

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 237);
Line: 2097

        delete  from ben_covered_dependents_f c
    	where c.contact_relationship_id in (
    	    select r.contact_relationship_id
    	    from per_contact_relationships r
    	    where r.contact_person_id = p_person_id
        );
Line: 2105

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23701);
Line: 2121

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 237);
Line: 2124

    select    count(*)
    into     v_dummy
    from    per_contact_relationships r
    where    r.person_id        = P_PERSON_ID;
Line: 2132

        delete    from per_contact_relationships r
        where    (r.person_id = P_PERSON_ID
        and    r.contact_person_id = EACH_CONTACT.CONTACT_PERSON_ID)
        or    (r.person_id = EACH_CONTACT.CONTACT_PERSON_ID
        and    r.contact_person_id = P_PERSON_ID);
Line: 2138

             hr_person_delete.check_contact(P_PERSON_ID,
                    EACH_CONTACT.CONTACT_PERSON_ID,
                    EACH_CONTACT.CONTACT_RELATIONSHIP_ID,
                    P_SESSION_DATE);
Line: 2147

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23701);
Line: 2150

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 24);
Line: 2153

        delete    from per_contact_relationships r
        where    r.contact_person_id    = P_PERSON_ID;
Line: 2157

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2401);
Line: 2160

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 25);
Line: 2163

        delete    from per_addresses a
        where    a.person_id    = P_PERSON_ID;
Line: 2167

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2501);
Line: 2170

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 25.5);
Line: 2173

        delete    from per_phones a
        where    a.parent_id    = P_PERSON_ID
                and a.parent_table = 'PER_ALL_PEOPLE_F';
Line: 2178

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 25501);
Line: 2181

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 26);
Line: 2189

        dbms_sql.parse(v_review_cursor,'DELETE from PER_PERFORMANCE_REVIEWS
                                        where person_id=:x',dbms_sql.v7);
Line: 2203

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 261);
Line: 2211

	-- Delete statement modified to improve performance.

	forall i in 1..l_assignment_id.count
		delete  from per_bookings b
		where    b.event_id in (select  e.event_id
         				from    per_events e
         				where    e.assignment_id = l_assignment_id(i));
Line: 2219

        /*delete  from per_bookings b
        where    b.event_id in
        (select    e.event_id
         from    per_events e
         where    exists (
            select    null
            from    per_assignments_f ass
            where    ass.assignment_id    = e.assignment_id
            and    ass.person_id         = P_PERSON_ID)
        );*/
Line: 2231

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 26101);
Line: 2234

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 262);
Line: 2238

    	-- Delete statement modified to improve performance.

    	forall i in 1..l_assignment_id.count
    		delete    from per_events e
        	where    e.assignment_id = l_assignment_id(i);
Line: 2244

       /* delete    from per_events e
        where    e.assignment_id in (
                    select ass.assignment_id
                    from   per_assignments_f ass
                    where  ass.person_id           = P_PERSON_ID);*/
Line: 2251

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 26201);
Line: 2254

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 27);
Line: 2257

        update    per_events e
        set    e.internal_contact_person_id    = null
        where    e.internal_contact_person_id    = P_PERSON_ID;
Line: 2262

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2701);
Line: 2265

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 28);
Line: 2268

        delete    from per_bookings b
        where    b.person_id    = P_PERSON_ID;
Line: 2272

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2801);
Line: 2275

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 29);
Line: 2278

        delete  from per_quickpaint_result_text q
        where   q.assignment_id in  (
                    select  ass.assignment_id
                    from    per_assignments_f ass
                    where   ass.person_id           = P_PERSON_ID);
Line: 2285

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2901);
Line: 2288

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 30);
Line: 2294

        delete    from hr_assignment_set_amendments h
        where  h.assignment_id in     (
                    select  ass.assignment_id
                    from    per_assignments_f ass
                    where   ass.person_id           = P_PERSON_ID);
Line: 2301

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3001);
Line: 2304

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 31);
Line: 2307

        delete  from pay_cost_allocations_f a
        where   a.assignment_id in (
                select  ass.assignment_id
                from    per_assignments_f ass
                where   ass.person_id           = P_PERSON_ID);
Line: 2314

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3101);
Line: 2317

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 32);
Line: 2320

        delete  from per_spinal_point_placements_f p
    where    p.assignment_id in (
        select  ass.assignment_id
        from    per_assignments_f ass
        where   ass.person_id           = P_PERSON_ID);
Line: 2327

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3201);
Line: 2330

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 33);
Line: 2336

        delete    from pay_assignment_actions a
        where    exists  (
                    select  null
                    from    per_assignments_f ass
                    where   ass.person_id     = P_PERSON_ID
                    and     ass.assignment_id = a.assignment_id);
Line: 2344

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3301);
Line: 2347

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 34);
Line: 2350

        delete    from pay_assignment_latest_balances b
        where   b.assignment_id in  (
                    select  ass.assignment_id
                    from    per_assignments_f ass
                    where   ass.person_id           = P_PERSON_ID);
Line: 2357

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3401);
Line: 2360

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 35);
Line: 2367

        	delete  from pay_assignment_link_usages_f u
        		where  u.assignment_id	= l_assignment_id(i);
Line: 2370

        /*delete  from pay_assignment_link_usages_f u
        where
        u.assignment_id in (
                   select ass.assignment_id
                   from per_assignments_f ass
                   where ass.person_id = P_PERSON_ID); */
Line: 2378

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3501);
Line: 2381

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 36);
Line: 2384

    delete    from pay_element_entry_values_f v
    where    v.element_entry_id in (
        select    e.element_entry_id
        from    pay_element_entries_f e
        where    exists (
            select    null
            from    per_assignments_f ass
            where    ass.assignment_id    = e.assignment_id
            and    ass.person_id        = P_PERSON_ID)
        );
Line: 2396

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3601);
Line: 2399

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 37);
Line: 2402

    delete    from pay_run_results r
    where    r.source_type    = 'E'
    and    r.source_id    in (
        select    e.element_entry_id
        from    pay_element_entries_f e
        where    exists (
            select    null
            from    per_assignments_f ass
            where    ass.assignment_id    = e.assignment_id
            and    ass.person_id        = P_PERSON_ID)
        );
Line: 2415

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3701);
Line: 2418

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 38);
Line: 2421

        delete    from pay_element_entries_f e
        where    e.assignment_id in (
                    select  ass.assignment_id
                    from    per_assignments_f ass
                    where   ass.person_id           = P_PERSON_ID);
Line: 2428

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3801);
Line: 2431

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 39);
Line: 2440

             Delete  pay_us_emp_fed_tax_rules_f peft
             Where   peft.assignment_id   in (
                     select ass.assignment_id
                     from per_assignments_f ass
                     where ass.person_id    = p_person_id );
Line: 2447

          hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',3802);
Line: 2452

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 40);
Line: 2454

             Delete  pay_us_emp_state_tax_rules_f pest
             Where   pest.assignment_id   in (
                     select ass.assignment_id
                     from per_assignments_f ass
                     where ass.person_id    = p_person_id );
Line: 2461

          hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',3803);
Line: 2466

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 41);
Line: 2468

             Delete  pay_us_emp_county_tax_rules_f pect
             Where   pect.assignment_id   in (
                     select ass.assignment_id
                     from per_assignments_f ass
                     where ass.person_id    = p_person_id );
Line: 2475

          hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',3804);
Line: 2480

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 42);
Line: 2482

             Delete  pay_us_emp_city_tax_rules_f pecit
             Where   pecit.assignment_id   in (
                     select ass.assignment_id
                     from per_assignments_f ass
                     where ass.person_id    = p_person_id );
Line: 2489

          hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',3805);
Line: 2496

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 43);
Line: 2499

        delete    from per_all_assignments_f a
        where    a.person_id     = P_PERSON_ID;
Line: 2503

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4001);
Line: 2506

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 44);
Line: 2509

    delete    from per_periods_of_service p
        where    p.person_id     = P_PERSON_ID;
Line: 2513

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4101);
Line: 2516

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 45);
Line: 2519

    delete    from per_applications a
        where    a.person_id     = P_PERSON_ID;
Line: 2523

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4201);
Line: 2528

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 46);
Line: 2531

        delete  from per_people_extra_info  e
        where   e.person_id     = P_PERSON_ID;
Line: 2535

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4301);
Line: 2543

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',47);
Line: 2547

 	select 	min(ptu1.effective_start_date)
	into	l_effective_date
	from 	per_person_type_usages_f ptu1
	where 	ptu1.person_type_usage_id = ptu_rec.person_type_usage_id;
Line: 2552

 	select 	ptu2.object_version_number
	into	l_object_version_number
	from 	per_person_type_usages_f ptu2
	where 	ptu2.person_type_usage_id = ptu_rec.person_type_usage_id
	and	ptu2.effective_start_date = l_effective_date;
Line: 2573

       hr_per_type_usage_internal.delete_person_type_usage
		(p_person_type_usage_id  => ptu_rec.person_type_usage_id
		,p_effective_date	 => l_effective_date
		,p_datetrack_mode 	 => 'ZAP'
		,p_object_version_number => l_object_version_number
		,p_effective_start_date  => l_effective_start_date
		,p_effective_end_date	 => l_effective_end_date
		);
Line: 2588

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 48);
Line: 2591

       delete from per_person_dlvry_methods
       where person_id = P_PERSON_ID;
Line: 2599

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 49);
Line: 2601

       delete from per_checklist_items
       where person_id = P_PERSON_ID;
Line: 2610

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 50);
Line: 2615

        delete from per_subjects_taken_tl st
         where st.subjects_taken_id IN ( select s.subjects_taken_id
                                           from per_subjects_taken s
                                              , per_qualifications q
                                          where q.person_id = P_PERSON_ID
                                            and s.qualification_id = q.qualification_id
                                       );
Line: 2623

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4698);
Line: 2626

        delete from per_subjects_taken s
        where s.qualification_id in ( select qualification_id
                                      from per_qualifications
                                      where person_id = P_PERSON_ID );
Line: 2631

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4699);
Line: 2634

        delete from per_qualifications_tl  qt
         where qt.qualification_id in ( select q.qualification_id
                                          from per_qualifications q
                                         where q.person_id = P_PERSON_ID
                                      );
Line: 2640

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4700);
Line: 2642

        delete  from per_qualifications  q
        where   q.person_id     = P_PERSON_ID;
Line: 2647

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4701);
Line: 2653

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 99);
Line: 2656

    delete    from per_all_people_f
        where    person_id = P_PERSON_ID;
Line: 2660

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4401);
Line: 2670

   hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 100);
Line: 2676

     per_medical_assessment_api.delete_medical_assessment
       (FALSE
       ,mea_rec.medical_assessment_id
       ,mea_rec.object_version_number);
Line: 2683

   hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 110);
Line: 2692

          per_disability_api.delete_disability(false,p_session_date ,'ZAP',v_disability_id, v_object_version_no, v_effective_start_date, v_effective_end_date);
Line: 2695

   hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 120);
Line: 2704

        per_work_incident_api.delete_work_incident(false,v_incident_id, v_object_version_number);
Line: 2707

   hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 130);
Line: 2716

        per_supplementary_role_api.delete_supplementary_role(false, v_role_id, v_ovn_roles);
Line: 2719

   hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 150);
Line: 2723

    delete    from per_periods_of_placement p
        where    p.person_id     = P_PERSON_ID;
Line: 2727

        hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4501);
Line: 2731

  END delete_a_person;
Line: 2737

      people_default_deletes
    DESCRIPTION
      Delete routine for deleting information set up as default when people
      are created. Used primarily for delete on PERPEEPI (Enter Person).
      The strong_predel_validation should first be performed to ensure that
      no additional info (apart from default) has been entered.
    NOTE
      See delete_a_person for p_form_call details. Further, p_form_call is
      set to TRUE when this procedure is called from check_contact as
      there is no need to check the existance of the contact.
  */
  --
  PROCEDURE people_default_deletes (p_person_id    IN number,
                    p_form_call    IN boolean)
  IS
  --
  v_assignment_id    number(15);
Line: 2756

        select  person_id
        from    per_people_f
        where   person_id       = P_PERSON_ID
        FOR     UPDATE;
Line: 2765

    hr_person_delete.person_existance_check(P_PERSON_ID);
Line: 2768

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 1);
Line: 2778

    ben_person_delete.delete_ben_rows(p_person_id);
Line: 2782

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 2);
Line: 2784

    hr_security.delete_per_from_list(P_PERSON_ID);
Line: 2786

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 4);
Line: 2794

        select    ass.assignment_id
    into    v_assignment_id
    from    per_assignments_f ass
    where    ass.person_id    = P_PERSON_ID
    FOR UPDATE;
Line: 2803

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 5);
Line: 2806

        delete  from pay_personal_payment_methods p
    where    p.assignment_id = V_ASSIGNMENT_ID;
Line: 2812

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 6);
Line: 2815

        delete  from per_assignment_budget_values_f v
        where   v.assignment_id = V_ASSIGNMENT_ID;
Line: 2821

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 7);
Line: 2824

        delete  from per_addresses a
    where    a.person_id    = P_PERSON_ID;
Line: 2830

    hr_utility.set_location('HR_PERSON_DELETE.DELETE_DEFAULT_DELETES', 7.5);
Line: 2833

        delete  from per_phones a
        where   a.parent_id     = P_PERSON_ID
                and a.parent_table = 'PER_ALL_PEOPLE_F';
Line: 2840

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 8);
Line: 2843

        delete  from pay_cost_allocations_f a
    where    a.assignment_id = V_ASSIGNMENT_ID;
Line: 2849

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 9);
Line: 2852

    delete    from pay_element_entry_values_f v
    where   exists (
            select   null
            from     pay_element_entries_f e
            where    e.assignment_id = V_ASSIGNMENT_ID
            and      e.element_entry_id = v.element_entry_id);
Line: 2862

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 10);
Line: 2865

    delete    from pay_run_results r
    where    r.source_type    = 'E'
    and    EXISTS (
            select null
            from    pay_element_entries_f e
            where    e.assignment_id = V_ASSIGNMENT_ID
                 and e.element_entry_id = r.source_id);
Line: 2876

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 11);
Line: 2879

        delete  from pay_element_entries_f e
        where   e.assignment_id = V_ASSIGNMENT_ID;
Line: 2885

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 12);
Line: 2890

    delete     from per_assignments_f ass
    where    ass.assignment_id = V_ASSIGNMENT_ID;
Line: 2894

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 13);
Line: 2897

    delete    from per_periods_of_service p
    where    p.person_id = P_PERSON_ID;
Line: 2903

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 14);
Line: 2906

        delete  from per_applications a
        where    a.person_id = P_PERSON_ID;
Line: 2914

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 17);
Line: 2916

       delete from per_checklist_items
       where person_id = P_PERSON_ID;
Line: 2925

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 15);
Line: 2929

    hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 16);
Line: 2932

        delete      from per_people_f
        where       person_id = P_PERSON_ID;
Line: 2939

    delete    from per_periods_of_placement p
    where    p.person_id = P_PERSON_ID;
Line: 2946

  END people_default_deletes;
Line: 2952

      applicant_default_deletes
    DESCRIPTION
      Delete routine for deleting information set up as default when
      applicants are entered.  Used primarily for delete on PERREAQE
      (Applicant Quick Entry). The strong_predel_validation should first be
      performed to ensure that no additional info (apart from default) has
      been entered.
    NOTE
      See delete_a_person for p_form_call details.
  */
  --
  PROCEDURE applicant_default_deletes (p_person_id IN number,
                       p_form_call IN boolean)
  IS
  --
  v_assignment_id       number(15);
Line: 2970

        select  person_id
        from    per_people_f
        where   person_id       = P_PERSON_ID
        FOR     UPDATE;
Line: 2979

    hr_person_delete.person_existance_check(P_PERSON_ID);
Line: 2982

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 1);
Line: 2988

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 3);
Line: 2991

        delete  from per_person_list l
        where    l.person_id = P_PERSON_ID;
Line: 2997

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 5);
Line: 3003

        select    ass.assignment_id
    into    v_assignment_id
    from    per_assignments_f ass
    where    ass.person_id    = P_PERSON_ID
    FOR UPDATE;
Line: 3010

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 6);
Line: 3013

        delete  from per_addresses a
        where   a.person_id     = P_PERSON_ID;
Line: 3019

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 6.5);
Line: 3022

        delete  from per_phones a
        where   a.parent_id     = P_PERSON_ID
                and a.parent_table = 'PER_ALL_PEOPLE_F';
Line: 3029

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 7);
Line: 3032

    delete     from per_assignments_f ass
    where    ass.assignment_id = V_ASSIGNMENT_ID;
Line: 3036

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 8);
Line: 3039

        delete  from per_applications a
        where    a.person_id = P_PERSON_ID;
Line: 3047

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 15);
Line: 3049

       delete from per_checklist_items
       where person_id = P_PERSON_ID;
Line: 3061

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 16);
Line: 3063

       delete from per_person_type_usages_f
       where person_id = P_PERSON_ID;
Line: 3072

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 9);
Line: 3074

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 9);
Line: 3078

    hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 10);
Line: 3081

        delete      from per_people_f
        where       person_id = P_PERSON_ID;
Line: 3087

  END applicant_default_deletes;