DBA Data[Home] [Help]

APPS.HR_PERSON_INTERNAL SQL Statements

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

Line: 30

    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: 65

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

  l_delete_permitted    varchar2(1);
Line: 95

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

  l_delete_permitted    varchar2(1);
Line: 128

  select 'Y'
  into   l_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: 164

  l_delete_permitted    varchar2(1);
Line: 170

    select 'Y'
    into   l_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: 204

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

  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: 274

  l_delete_permitted    varchar2(1);
Line: 280

    select 'Y'
    into   l_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: 312

  l_delete_permitted    varchar2(1);
Line: 326

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

  l_delete_contact       varchar2(1);
Line: 385

    select 'Y'
    into   l_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: 408

    select 'Y'
    into   l_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: 428

        l_delete_contact := 'Y';
Line: 433

            l_delete_contact := 'N';
Line: 436

    if l_delete_contact = 'Y' then
       hr_person_internal.people_default_deletes(P_CONTACT_PERSON_ID);
Line: 451

PROCEDURE delete_org_manager(p_person_id in number
                            ,p_effective_date in date
                            ,p_person_org_manager_warning out nocopy varchar2) IS
  --
  cursor csr_org_details(p_organization_id number) is
    select org_info.organization_id,
           org_info.org_information_id,
           org_info.org_information_context,
           org_info.org_information1,
           org_info.org_information2,
           org_info.org_information3,
           org_info.org_information4,
           org_info.org_information5,
           org_info.org_information6,
           org_info.org_information7,
           org_info.org_information8,
           org_info.org_information9,
           org_info.org_information10,
           org_info.org_information11,
           org_info.org_information12,
           org_info.org_information13,
           org_info.org_information14,
           org_info.org_information15,
           org_info.org_information16,
           org_info.org_information17,
           org_info.org_information18,
           org_info.org_information19,
           org_info.org_information20,
           org_info.object_version_number,
           org_info.attribute_category,
           org_info.attribute1,
           org_info.attribute2,
           org_info.attribute3,
           org_info.attribute4,
           org_info.attribute5,
           org_info.attribute6,
           org_info.attribute7,
           org_info.attribute8,
           org_info.attribute9,
           org_info.attribute10,
           org_info.attribute11,
           org_info.attribute12,
           org_info.attribute13,
           org_info.attribute14,
           org_info.attribute15,
           org_info.attribute16,
           org_info.attribute17,
           org_info.attribute18,
           org_info.attribute19,
           org_info.attribute20
    from   hr_organization_information org_info
    where  org_info.organization_id = p_organization_id
    and    org_info.org_information_context = 'Organization Name Alias'
    and    org_info.org_information2 = to_char(p_person_id);
Line: 509

    select org.organization_id,
           org_tl.name
    from   hr_all_organization_units org,
           hr_all_organization_units_tl org_tl
    where  org.organization_id = org_tl.organization_id
    and    exists (select null
                   from   hr_organization_information org_info
                   where  org_info.organization_id = org.organization_id
                   and    org_info.org_information_context = 'Organization Name Alias'
                   and    org_info.org_information2 = to_char(p_person_id));
Line: 549

              hr_organization_api.delete_org_manager
                (p_org_information_id    => l_org_details.org_information_id,
                 p_object_version_number => l_org_details.object_version_number);
Line: 555

              hr_organization_api.update_org_manager
                (p_effective_date        => p_effective_date
                ,p_organization_id       => l_org_details.organization_id
                ,p_org_information_id    => l_org_details.org_information_id
                ,p_org_info_type_code    => l_org_details.org_information_context
                ,p_org_information1      => l_org_details.org_information1
                ,p_org_information2      => null
                ,p_org_information3      => null
                ,p_org_information4      => null
                ,p_org_information5      => l_org_details.org_information5
                ,p_org_information6      => l_org_details.org_information6
                ,p_org_information7      => l_org_details.org_information7
                ,p_org_information8      => l_org_details.org_information8
                ,p_org_information9      => l_org_details.org_information9
                ,p_org_information10     => l_org_details.org_information10
                ,p_org_information11     => l_org_details.org_information11
                ,p_org_information12     => l_org_details.org_information12
                ,p_org_information13     => l_org_details.org_information13
                ,p_org_information14     => l_org_details.org_information14
                ,p_org_information15     => l_org_details.org_information15
                ,p_org_information16     => l_org_details.org_information16
                ,p_org_information17     => l_org_details.org_information17
                ,p_org_information18     => l_org_details.org_information18
                ,p_org_information19     => l_org_details.org_information19
                ,p_org_information20     => l_org_details.org_information20
                ,p_attribute_category    => l_org_details.attribute_category
                ,p_attribute1            => l_org_details.attribute1
                ,p_attribute2            => l_org_details.attribute2
                ,p_attribute3            => l_org_details.attribute3
                ,p_attribute4            => l_org_details.attribute4
                ,p_attribute5            => l_org_details.attribute5
                ,p_attribute6            => l_org_details.attribute6
                ,p_attribute7            => l_org_details.attribute7
                ,p_attribute8            => l_org_details.attribute8
                ,p_attribute9            => l_org_details.attribute9
                ,p_attribute10           => l_org_details.attribute10
                ,p_attribute11           => l_org_details.attribute11
                ,p_attribute12           => l_org_details.attribute12
                ,p_attribute13           => l_org_details.attribute13
                ,p_attribute14           => l_org_details.attribute14
                ,p_attribute15           => l_org_details.attribute15
                ,p_attribute16           => l_org_details.attribute16
                ,p_attribute17           => l_org_details.attribute17
                ,p_attribute18           => l_org_details.attribute18
                ,p_attribute19           => l_org_details.attribute19
                ,p_attribute20           => l_org_details.attribute20
                ,p_object_version_number => l_org_details.object_version_number
                ,p_warning               => l_warning);
Line: 623

END delete_org_manager;
Line: 640

  l_delete_permitted varchar2(1);
Line: 648

       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: 706

    DELETE FROM ben_ext_chg_evt_log
    WHERE  CURRENT OF ben_ext_chg_log;
Line: 765

  l_delete_permitted varchar2(1);
Line: 771

     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: 789

 select count(*)
  into   l_person_types
  from   per_people_f ppf,
         per_person_types ppt
  where  ppf.person_id     = P_PERSON_ID
  and    ppf.effective_end_date >= p_effective_date
  and    ppf.person_type_id = ppt.person_type_id
  and (   exists
         (select null
          from   per_people_f ppf2,
                 per_person_types ppt2
          where  ppf2.person_id    = ppf.person_id
          and    ppf2.effective_end_date >= p_effective_date
          and    ppf2.person_type_id = ppt2.person_type_id
          and    ppt2.system_person_type <> ppt.system_person_type
         )
  or exists
  ( select null
  from per_periods_of_placement ppp
  where ppp.person_id=ppf.person_id
  and actual_termination_date>=p_effective_date
  and actual_termination_date is not null)); --fix for bug 6730008.
Line: 828

    select 'Y'
    into   l_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_effective_date );
Line: 837

    select 'Y'
    into   l_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_effective_date
                  and    a.assignment_id = r.assignment_id));
Line: 862

    select 'Y'
    into   l_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: 883

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

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

    select 'Y'
    into   l_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_effective_date);
Line: 944

    select 'Y'
    into   l_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: 965

    select 'Y'
    into   l_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: 985

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

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

    select 'Y'
    into   l_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: 1046

    select 'Y'
    into   l_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: 1067

    select 'Y'
    into   l_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: 1088

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

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

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

    select 'Y'
    into   l_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: 1178

    select 'Y'
    into   l_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: 1201

    select 'Y'
    into   l_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: 1225

    select 'Y'
    into   l_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: 1249

    select 'Y'
    into   l_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: 1273

    select 'Y'
    into   l_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: 1297

    select 'Y'
    into   l_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: 1321

    select 'Y'
    into   l_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: 1350

    DELETE FROM ben_ext_chg_evt_log
    WHERE  CURRENT OF ben_ext_chg_log;
Line: 1359

  ben_person_delete.perform_ri_check(p_person_id);
Line: 1448

PROCEDURE people_default_deletes (p_person_id    IN number)
IS
  --
  l_assignment_id    number(15);
Line: 1452

  l_proc             varchar2(72) := g_package||'people_default_deletes';
Line: 1457

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

    SELECT attached_document_id
    FROM   fnd_attached_documents
    WHERE  pk1_value = l_pk1_value1;
Line: 1468

        select datatype_id
          from fnd_attached_docs_form_vl
         where attached_document_id =  x_attached_document_id;
Line: 1496

  ben_person_delete.delete_ben_rows(p_person_id);
Line: 1504

  hr_security.delete_per_from_list(P_PERSON_ID);
Line: 1517

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

    delete from pay_personal_payment_methods p
    where  p.assignment_id = l_assignment_id;
Line: 1544

    delete from per_assignment_budget_values_f v
    where  v.assignment_id = l_assignment_id;
Line: 1555

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

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

    delete from pay_cost_allocations_f a
    where  a.assignment_id = l_assignment_id;
Line: 1589

    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  e.assignment_id = l_assignment_id);
Line: 1603

    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  e.assignment_id = l_assignment_id);
Line: 1618

    delete from pay_element_entries_f e
    where  e.assignment_id = l_assignment_id;
Line: 1631

    delete from per_assignments_f ass
    where  ass.assignment_id = l_assignment_id;
Line: 1640

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

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

    delete from per_checklist_items
    where  person_id = P_PERSON_ID;
Line: 1684

    delete from per_people_f
    where  person_id = P_PERSON_ID;
Line: 1695

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

        FND_ATTACHED_DOCUMENTS3_PKG.delete_row (l_attached_document_id,
                                                l_datatype_id,
                                                'Y' );
Line: 1730

END people_default_deletes;
Line: 1744

PROCEDURE applicant_default_deletes(p_person_id IN number)
IS
  --
  l_assignment_id      number(15);
Line: 1748

  l_proc               varchar2(72) := g_package||'applicant_default_deletes';
Line: 1753

  SELECT person_id
  FROM   per_people_f
  WHERE  person_id = P_PERSON_ID
  FOR    UPDATE;
Line: 1759

    SELECT attached_document_id
    FROM   fnd_attached_documents
    WHERE  pk1_value = l_pk1_value2;
Line: 1764

        select datatype_id
          from fnd_attached_docs_form_vl
         where attached_document_id =  x_attached_document_id;
Line: 1793

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

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

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

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

    delete from per_assignments_f ass
    where  ass.assignment_id = l_assignment_id;
Line: 1851

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

    delete from per_checklist_items
    where  person_id = P_PERSON_ID;
Line: 1879

    delete from per_person_type_usages_f
    where  person_id = P_PERSON_ID;
Line: 1898

    delete from per_people_f
    where  person_id = P_PERSON_ID;
Line: 1921

          FND_ATTACHED_DOCUMENTS3_PKG.delete_row (l_attached_document_id,
                                                  l_datatype_id,
                                                  'Y' );
Line: 1933

END applicant_default_deletes;
Line: 1939

PROCEDURE delete_person (p_person_id          IN number
                        ,p_effective_date     IN date)
IS
  --
    l_pk1_value3   varchar2(72) := p_person_id;
Line: 1946

  SELECT contact_person_id,
         contact_relationship_id
  FROM   per_contact_relationships
  WHERE  person_id = P_PERSON_ID;
Line: 1952

  SELECT person_id
  FROM   per_people_f
  WHERE  person_id = P_PERSON_ID
  FOR    UPDATE;
Line: 1958

  SELECT assignment_id
  FROM   per_assignments_f
  WHERE  person_id    = P_PERSON_ID
  FOR    UPDATE;
Line: 1963

  CURSOR csr_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: 1972

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

  SELECT incident_id, object_version_number
  FROM   per_work_incidents
  WHERE  person_id =  p_person_id;
Line: 1983

  SELECT disability_id, object_version_number,
         effective_start_date, effective_end_date
  FROM   per_disabilities_f
  WHERE  person_id = p_person_id;
Line: 1989

  SELECT role_id, object_version_number
  FROM   per_roles
  WHERE  person_id= p_person_id;
Line: 1994

  SELECT distinct person_type_usage_id
  FROM   per_person_type_usages_f ptu
  WHERE  ptu.person_id = p_person_id
  ORDER BY person_type_usage_id;
Line: 2000

  SELECT distinct assignment_id
  FROM   per_assignments_f
  WHERE  person_id = p_person_id;
Line: 2005

    SELECT attached_document_id
    FROM   fnd_attached_documents
    WHERE  pk1_value = l_pk1_value3;
Line: 2010

        select datatype_id
          from fnd_attached_docs_form_vl
         where attached_document_id =  x_attached_document_id;
Line: 2040

  l_proc varchar2(72) := g_package||'delete_person';
Line: 2082

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

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

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

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

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

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

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

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

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

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

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

        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: 2284

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

   begin -- Delete from HR_QUEST_ANSWER_VALUES: APPRAISALS
    begin
     select 2
     into l_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: 2305

        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: 2320

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

   end; -- Delete from HR_QUEST_ANSWER_VALUES
Line: 2323

/*    -- Delete from HR_QUEST_ANSWER_VALUES
    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: 2350

       delete from hr_quest_answers qsa2
       where  qsa2.questionnaire_answer_id in
           (
            select qsa.questionnaire_answer_id
            from   hr_quest_answers qsa
                  ,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))
            Union  All

            select qsa.questionnaire_answer_id
            from   hr_quest_answers qsa
                  ,per_participants par
            where  (qsa.type_object_id = par.participant_id
                    and qsa.type='PARTICIPANT'
                    and  par.person_id =  p_person_id )
           ) ;
Line: 2382

       delete from per_participants par2
       where  par2.participant_id in
       (  select par.participant_id
          from   per_participants par
          where  par.person_id =  P_PERSON_Id
          union all
          select  par.participant_id
          from    per_participants par
                 ,per_appraisals apr
          where
                 (par.participation_in_column = 'APPRAISAL_ID'
                  and par.participation_in_table = 'PER_APPRAISALS'
                  and participation_in_id = apr.appraisal_id
                  and (apr.appraisee_person_id = P_PERSON_ID
                       or apr.appraiser_person_id = p_person_id)
                  )
           );
Line: 2411

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

  hr_security.delete_per_from_list(P_PERSON_ID);
Line: 2434

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

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

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

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

    OPEN csr_delete_components;
Line: 2518

      FETCH csr_delete_components INTO l_proposal_id;
Line: 2519

      EXIT WHEN csr_delete_components%NOTFOUND;
Line: 2520

      DELETE FROM per_pay_proposal_components
      WHERE pay_proposal_id = l_proposal_id;
Line: 2524

    CLOSE csr_delete_components;
Line: 2528

    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: 2548

    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: 2567

    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: 2586

    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: 2605

    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: 2628

    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: 2652

    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: 2679

    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: 2703

    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: 2730

    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: 2754

    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: 2781

    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: 2800

    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: 2831

    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: 2863

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

        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: 2899

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

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

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

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

       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: 2989

        /*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: 3015

      delete from per_events e
      where  e.assignment_id = l_assignment_id(i);
Line: 3018

       /* 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: 3036

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

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

    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: 3091

    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: 3110

    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: 3129

    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: 3151

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

    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: 3192

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

        /*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: 3214

    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: 3238

    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: 3263

    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: 3287

    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: 3306

    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: 3325

    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: 3344

    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: 3366

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

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

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

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

    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: 3442

    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: 3468

      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: 3489

    delete from per_person_dlvry_methods
    where  person_id = P_PERSON_ID;
Line: 3502

    delete from per_checklist_items
    where person_id = P_PERSON_ID;
Line: 3518

  select distinct party_id into l_party_id
    from per_all_people_f
   where person_id = p_person_id;
Line: 3522

  select count(distinct person_id) into l_count
    from per_all_people_f
   where party_id = l_party_id;
Line: 3529

    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.party_id = l_party_id
               and s.qualification_id = q.qualification_id
         );
Line: 3542

    delete from per_subjects_taken s
          where s.qualification_id in
            (select qualification_id
               from per_qualifications
               where party_id = l_party_id );
Line: 3552

    delete from per_qualifications_tl  qt
           where qt.qualification_id in
             (select q.qualification_id
               from per_qualifications q
               where q.party_id = l_party_id);
Line: 3562

    delete from per_qualifications  q
         where q.party_id = l_party_id;
Line: 3578

 /*   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: 3591

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

    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: 3611

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

ben_person_delete.delete_ben_rows(P_PERSON_ID);
Line: 3633

    delete    from per_all_people_f
    where    person_id = P_PERSON_ID;
Line: 3657

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

    per_disability_api.delete_disability(false,p_effective_date ,'ZAP',l_disability_id, l_object_version_no, l_effective_start_date, l_effective_end_date);
Line: 3689

    per_work_incident_api.delete_work_incident(false,l_incident_id, l_object_version_number);
Line: 3703

    per_supplementary_role_api.delete_supplementary_role(false, l_role_id, l_ovn_roles);
Line: 3712

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

         FND_ATTACHED_DOCUMENTS3_PKG.delete_row (l_attached_document_id,
                                                 l_datatype_id,
                                                 'Y' );
Line: 3750

END delete_person;