The following lines contain the word 'select', 'insert', 'update' or 'delete':
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
);
select count(*)
into v_dummy
from per_all_people_f p
where p.person_id = P_PERSON_ID;
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);
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');
ben_person_delete.check_ben_rows_before_delete(p_person_id
,p_effective_date);
v_delete_permitted varchar2(1);
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
);
v_delete_permitted varchar2(1);
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)
);
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;
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);
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);
v_delete_permitted varchar2(1);
select null
into v_delete_permitted
from sys.dual
where not exists(select null
from per_contracts_f
where person_id = p_person_id);
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);
v_delete_permitted varchar2(1);
hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',1);
hr_person_delete.person_existance_check(P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',2);
hr_person_delete.product_installed('PAY', v_pay_status,
v_pay_installed, v_oracle_id);
hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',4);
if upper(p_dt_delete_mode) not in ('DELETE_NEXT_CHANGE','FUTURE_CHANGE') then
hr_person_delete.aol_predel_validation(P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',5);
hr_person_delete.assignment_set_check(P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',6);
hr_person_delete.pay_predel_validation(P_PERSON_ID);
hr_person_delete.ben_predel_validation(P_PERSON_ID,p_session_date);
hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',8);
hr_person_delete.closed_element_entry_check(P_PERSON_ID, P_SESSION_DATE);
hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',9);
hr_person_delete.contact_cobra_validation(P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',10);
hr_person_delete.contracts_check(P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.WEAK_PREDEL_VALIDATION',11);
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);
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;
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 1);
hr_person_delete.person_existance_check(P_PERSON_ID);
hr_person_delete.assignment_set_check(P_PERSON_ID);
if upper(p_dt_delete_mode) not in ('DELETE_NEXT_CHANGE','FUTURE_CHANGE') then
hr_person_delete.aol_predel_validation(P_PERSON_ID);
hr_person_delete.pay_predel_validation(P_PERSON_ID);
hr_person_delete.ben_predel_validation(P_PERSON_ID,p_session_date);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 2);
-- 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 );
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));
/* 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));*/
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 3);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 5);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 6);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 7);
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
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 8);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 9);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 10);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 11);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 12);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 13);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION',13);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION',13);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 14);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 15);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 16);
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');
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 17);
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');
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 171);
hr_person_delete.closed_element_entry_check(P_PERSON_ID, P_SESSION_DATE);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 18);
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));
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 19);
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));
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 20);
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));
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 21);
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));
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 22);
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));
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 26);
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));
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 27);
hr_person_delete.contact_cobra_validation(P_PERSON_ID);
hr_person_delete.contracts_check(P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 28);
DELETE FROM ben_ext_chg_evt_log
WHERE CURRENT OF ben_ext_chg_log;
ben_person_delete.perform_ri_check(p_person_id);
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);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 29);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 30);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 31);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 32);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 33);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 34);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 35);
hr_utility.set_location('HR_PERSON_DELETE.MODERATE_PREDEL_VALIDATION', 36);
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;
hr_utility.set_location('HR_PERSON_DELETE.STRONG_PREDEL_VALIDATION', 1);
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
);
hr_utility.set_location('HR_PERSON_DELETE.STRONG_PREDEL_VALIDATION', 1);
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
);
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);
v_delete_contact varchar2(1);
hr_utility.set_location('HR_PERSON_DELETE.CHECK_CONTACT', 1);
hr_person_delete.person_existance_check(P_CONTACT_PERSON_ID);
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);
hr_utility.set_location('HR_PERSON_DELETE.CHECK_CONTACT', 2);
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');
v_delete_contact := 'Y';
hr_person_delete.strong_predel_validation(P_CONTACT_PERSON_ID,
P_SESSION_DATE);
v_delete_contact := 'N';
if v_delete_contact = 'Y' then
hr_person_delete.people_default_deletes(P_CONTACT_PERSON_ID,
TRUE);
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;
select person_id
from per_people_f
where person_id = P_PERSON_ID
FOR UPDATE;
select assignment_id
from per_assignments_f
where person_id = P_PERSON_ID
FOR UPDATE;
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;
SELECT medical_assessment_id,
object_version_number
FROM per_medical_Assessments pma
WHERE pma.person_id = p_person_id;
select incident_id, object_version_number
from per_work_incidents
where person_id = p_person_id;
select disability_id, object_version_number, effective_start_date, effective_end_date
from per_disabilities_f
where person_id = p_person_id;
select role_id, object_version_number
from per_roles
where person_id= p_person_id;
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;
select distinct assignment_id
from per_assignments_f
where person_id = p_person_id;
hr_person_delete.person_existance_check(P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 0);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 888);
update per_requisitions r
set r.person_id = null
where r.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 101);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2);
delete from per_letter_request_lines l
where l.person_id = P_PERSON_ID;
delete from per_letter_request_lines l
where l.assignment_id = l_assignment_id(i);
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);*/
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 201);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3);
delete from per_absence_attendances a
where a.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 301);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4);
update per_absence_attendances a
set a.authorising_person_id = null
where a.authorising_person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 401);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 5);
update per_absence_attendances a
set a.replacement_person_id = null
where a.replacement_person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 501);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 6);
delete from per_person_analyses a
where a.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 601);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 8);
update per_periods_of_service p
set p.termination_accepted_person_id = null
where p.termination_accepted_person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 801);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 9);
update per_recruitment_activities r
set r.authorising_person_id = null
where r.authorising_person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 901);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 10);
update per_recruitment_activities r
set r.internal_contact_person_id = null
where r.internal_contact_person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1001);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',11);
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);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 215); --added for bug 5464252
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 211);
end; -- Delete from HR_QUEST_ANSWER_VALUES: PARTICIPANTS
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));
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));
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 220);
end; -- Delete from HR_QUEST_ANSWER_VALUES: APPRAISALS
end; -- 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
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1101);
DELETE
FROM per_objectives
WHERE scorecard_id IN (SELECT scorecard_id
FROM per_personal_scorecards
WHERE person_id = P_PERSON_ID)
OR appraisal_id in (SELECT appraisal_id
FROM per_appraisals
WHERE appraisee_person_id = p_person_id) ;
DELETE
FROM per_scorecard_sharing
WHERE scorecard_id IN (SELECT scorecard_id
FROM per_personal_scorecards
WHERE person_id = P_PERSON_ID);
DELETE
FROM hr_api_transaction_steps
WHERE transaction_id IN (SELECT a.transaction_id
FROM hr_api_transactions a,
per_personal_scorecards sc
WHERE a.transaction_ref_table = 'PER_PERSONAL_SCORECARDS'
AND a.transaction_ref_id = sc.scorecard_id
AND sc.person_id = P_PERSON_ID);
DELETE
FROM hr_api_transactions
WHERE transaction_id IN (SELECT transaction_id
FROM hr_api_transactions a,
per_personal_scorecards sc
WHERE a.transaction_ref_table = 'PER_PERSONAL_SCORECARDS'
AND a.transaction_ref_id = sc.scorecard_id
AND sc.person_id = P_PERSON_ID);
DELETE
FROM per_personal_scorecards
WHERE person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1111);
DELETE
FROM per_competence_elements
WHERE assessment_id IN (SELECT assessment_id
FROM per_assessments
WHERE appraisal_id IN (SELECT appraisal_id
FROM per_appraisals
WHERE appraisee_person_id = P_PERSON_ID));
DELETE
FROM per_performance_ratings
WHERE appraisal_id IN (SELECT appraisal_id
FROM per_appraisals
WHERE appraisee_person_id = P_PERSON_ID);
DELETE
FROM per_assessments
WHERE appraisal_id IN (SELECT appraisal_id
FROM per_appraisals
WHERE appraisee_person_id = P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1112);
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
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1102);
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
)
)
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1103);
delete from per_appraisals apr
where --apr.appraiser_person_id = P_PERSON_ID or -- changed as part of bug#8265994
apr.appraisee_person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1104);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 12);
hr_security.delete_per_from_list(P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 14);
update per_vacancies v
set v.recruiter_id = null
where v.recruiter_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1401);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 15);
update per_assignments_f ass
set ass.person_referred_by_id = null
where ass.person_referred_by_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1501);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 16);
update per_assignments_f a
set a.recruiter_id = null
where a.recruiter_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1601);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 17);
update per_assignments_f a
set a.supervisor_id = null
where a.supervisor_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1701);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 18);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 185);
open DELETE_COMPONENTS;
FETCH DELETE_COMPONENTS INTO v_proposal_id;
EXIT WHEN DELETE_COMPONENTS%NOTFOUND;
DELETE FROM per_pay_proposal_components
WHERE pay_proposal_id = v_proposal_id;
close DELETE_COMPONENTS;
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1801);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 19);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 1901);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 20);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2001);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 21);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2101);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 22);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2201);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23);
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)
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2301);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 230);
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)
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23001);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 231);
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)
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23101);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 232);
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)
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23201);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 233);
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)
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23301);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 234);
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)
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23401);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 235);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23501);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 236);
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)
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23601);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 237);
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
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23701);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 237);
select count(*)
into v_dummy
from per_contact_relationships r
where r.person_id = P_PERSON_ID;
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);
hr_person_delete.check_contact(P_PERSON_ID,
EACH_CONTACT.CONTACT_PERSON_ID,
EACH_CONTACT.CONTACT_RELATIONSHIP_ID,
P_SESSION_DATE);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 23701);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 24);
delete from per_contact_relationships r
where r.contact_person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2401);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 25);
delete from per_addresses a
where a.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2501);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 25.5);
delete from per_phones a
where a.parent_id = P_PERSON_ID
and a.parent_table = 'PER_ALL_PEOPLE_F';
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 25501);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 26);
dbms_sql.parse(v_review_cursor,'DELETE from PER_PERFORMANCE_REVIEWS
where person_id=:x',dbms_sql.v7);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 261);
-- 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));
/*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)
);*/
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 26101);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 262);
-- 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);
/* 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);*/
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 26201);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 27);
update per_events e
set e.internal_contact_person_id = null
where e.internal_contact_person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2701);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 28);
delete from per_bookings b
where b.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2801);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 29);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 2901);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 30);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3001);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 31);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3101);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 32);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3201);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 33);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3301);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 34);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3401);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 35);
delete from pay_assignment_link_usages_f u
where u.assignment_id = l_assignment_id(i);
/*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); */
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3501);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 36);
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)
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3601);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 37);
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)
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3701);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 38);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 3801);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 39);
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 );
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',3802);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 40);
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 );
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',3803);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 41);
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 );
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',3804);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 42);
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 );
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',3805);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 43);
delete from per_all_assignments_f a
where a.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4001);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 44);
delete from per_periods_of_service p
where p.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4101);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 45);
delete from per_applications a
where a.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4201);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 46);
delete from per_people_extra_info e
where e.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4301);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON',47);
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;
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;
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
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 48);
delete from per_person_dlvry_methods
where person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 49);
delete from per_checklist_items
where person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 50);
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
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4698);
delete from per_subjects_taken s
where s.qualification_id in ( select qualification_id
from per_qualifications
where person_id = P_PERSON_ID );
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4699);
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
);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4700);
delete from per_qualifications q
where q.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4701);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 99);
delete from per_all_people_f
where person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4401);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 100);
per_medical_assessment_api.delete_medical_assessment
(FALSE
,mea_rec.medical_assessment_id
,mea_rec.object_version_number);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 110);
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);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 120);
per_work_incident_api.delete_work_incident(false,v_incident_id, v_object_version_number);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 130);
per_supplementary_role_api.delete_supplementary_role(false, v_role_id, v_ovn_roles);
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 150);
delete from per_periods_of_placement p
where p.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_A_PERSON', 4501);
END delete_a_person;
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);
select person_id
from per_people_f
where person_id = P_PERSON_ID
FOR UPDATE;
hr_person_delete.person_existance_check(P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 1);
ben_person_delete.delete_ben_rows(p_person_id);
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 2);
hr_security.delete_per_from_list(P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 4);
select ass.assignment_id
into v_assignment_id
from per_assignments_f ass
where ass.person_id = P_PERSON_ID
FOR UPDATE;
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 5);
delete from pay_personal_payment_methods p
where p.assignment_id = V_ASSIGNMENT_ID;
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 6);
delete from per_assignment_budget_values_f v
where v.assignment_id = V_ASSIGNMENT_ID;
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 7);
delete from per_addresses a
where a.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.DELETE_DEFAULT_DELETES', 7.5);
delete from per_phones a
where a.parent_id = P_PERSON_ID
and a.parent_table = 'PER_ALL_PEOPLE_F';
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 8);
delete from pay_cost_allocations_f a
where a.assignment_id = V_ASSIGNMENT_ID;
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 9);
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);
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 10);
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);
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 11);
delete from pay_element_entries_f e
where e.assignment_id = V_ASSIGNMENT_ID;
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 12);
delete from per_assignments_f ass
where ass.assignment_id = V_ASSIGNMENT_ID;
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 13);
delete from per_periods_of_service p
where p.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 14);
delete from per_applications a
where a.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 17);
delete from per_checklist_items
where person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 15);
hr_utility.set_location('HR_PERSON_DELETE.PEOPLE_DEFAULT_DELETES', 16);
delete from per_people_f
where person_id = P_PERSON_ID;
delete from per_periods_of_placement p
where p.person_id = P_PERSON_ID;
END people_default_deletes;
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);
select person_id
from per_people_f
where person_id = P_PERSON_ID
FOR UPDATE;
hr_person_delete.person_existance_check(P_PERSON_ID);
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 1);
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 3);
delete from per_person_list l
where l.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 5);
select ass.assignment_id
into v_assignment_id
from per_assignments_f ass
where ass.person_id = P_PERSON_ID
FOR UPDATE;
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 6);
delete from per_addresses a
where a.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 6.5);
delete from per_phones a
where a.parent_id = P_PERSON_ID
and a.parent_table = 'PER_ALL_PEOPLE_F';
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 7);
delete from per_assignments_f ass
where ass.assignment_id = V_ASSIGNMENT_ID;
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 8);
delete from per_applications a
where a.person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 15);
delete from per_checklist_items
where person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 16);
delete from per_person_type_usages_f
where person_id = P_PERSON_ID;
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 9);
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 9);
hr_utility.set_location('HR_PERSON_DELETE.APPLICANT_DEFAULT_DELETES', 10);
delete from per_people_f
where person_id = P_PERSON_ID;
END applicant_default_deletes;