DECLARE
p_datetrack_update_mode VARCHAR2 (200);
CURSOR mb_ass
IS
SELECT *
FROM xx_hr_ass_data_upload_new r
WHERE r.business_group_id = (SELECT DISTINCT organization_id
FROM hr_organization_units_v
WHERE NAME =
'NOL Business Group');
p_assignment_id NUMBER (20);
v_person_id NUMBER (20);
v_grade_id NUMBER (20);
v_pos_id NUMBER (20);
p_object_version_number NUMBER (2);
p_people_group_id NUMBER (20);
p_concat_segments VARCHAR2 (300);
v_job_id NUMBER (20);
p_employment_category VARCHAR2 (200);
p_concat_segments VARCHAR2 (200);
p_grade_ladder_pgm_id NUMBER;
p_supervisor_assignment_id NUMBER;
p_object_version_date DATE;
p_special_ceiling_step_id NUMBER;
p_group_name VARCHAR2 (200);
p_effective_start_date DATE := NULL;
p_effective_date DATE;
p_effective_end_date DATE := NULL;
p_org_now_no_manager_warning BOOLEAN;
p_other_manager_warning BOOLEAN;
p_spp_delete_warning BOOLEAN;
p_entries_changed_warning VARCHAR2 (200);
p_tax_district_changed_warning BOOLEAN;
p_api_error VARCHAR (4000);
v_organization_id NUMBER;
v_org VARCHAR2 (300);
v_people VARCHAR2 (300);
v_loc NUMBER;
p_business_group_id NUMBER;
v_pay_basis_id NUMBER;
v_payroll_id NUMBER;
BEGIN
p_special_ceiling_step_id := NULL;
FOR rec IN mb_ass
LOOP
BEGIN
SELECT assignment_id, a.effective_start_date,
a.object_version_number --, a.location_id, people_group_id
INTO p_assignment_id, p_effective_date,
p_object_version_number --, v_loc, p_people_group_id
FROM per_all_assignments_f a
WHERE person_id = rec.person_id
AND effective_end_date = TO_DATE ('31/12/4712', 'DD/MM/YYYY');
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;
BEGIN
p_datetrack_update_mode := 'CORRECTION';
p_people_group_id := rec.people_group_id;
hr_assignment_api.update_emp_asg_criteria
(p_effective_date => p_effective_date,
p_datetrack_update_mode => p_datetrack_update_mode,
p_assignment_id => rec.assignment_id,
p_validate => FALSE,
p_called_from_mass_update => NULL,
p_grade_id => rec.grade_id,
p_position_id => rec.position_id,
p_job_id => rec.job_id, --v_job_id,
p_payroll_id => rec.payroll_id,
p_pay_basis_id => rec.main_salary_basis_id,
p_location_id => rec.location_id, --v_loc,
p_organization_id => rec.organization_id,
p_people_group_id => p_people_group_id,
p_object_version_number => p_object_version_number,
p_special_ceiling_step_id => p_special_ceiling_step_id,
p_group_name => p_group_name,
p_effective_start_date => p_effective_start_date,
p_effective_end_date => p_effective_end_date,
p_org_now_no_manager_warning => p_org_now_no_manager_warning,
p_other_manager_warning => p_other_manager_warning,
p_spp_delete_warning => p_spp_delete_warning,
p_entries_changed_warning => p_entries_changed_warning,
p_tax_district_changed_warning => p_tax_district_changed_warning
);
COMMIT;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
p_api_error := NULL;
p_api_error := SQLERRM;
p_people_group_id := NULL;
COMMIT;
END;
END LOOP;
END;
p_datetrack_update_mode VARCHAR2 (200);
CURSOR mb_ass
IS
SELECT *
FROM xx_hr_ass_data_upload_new r
WHERE r.business_group_id = (SELECT DISTINCT organization_id
FROM hr_organization_units_v
WHERE NAME =
'NOL Business Group');
p_assignment_id NUMBER (20);
v_person_id NUMBER (20);
v_grade_id NUMBER (20);
v_pos_id NUMBER (20);
p_object_version_number NUMBER (2);
p_people_group_id NUMBER (20);
p_concat_segments VARCHAR2 (300);
v_job_id NUMBER (20);
p_employment_category VARCHAR2 (200);
p_concat_segments VARCHAR2 (200);
p_grade_ladder_pgm_id NUMBER;
p_supervisor_assignment_id NUMBER;
p_object_version_date DATE;
p_special_ceiling_step_id NUMBER;
p_group_name VARCHAR2 (200);
p_effective_start_date DATE := NULL;
p_effective_date DATE;
p_effective_end_date DATE := NULL;
p_org_now_no_manager_warning BOOLEAN;
p_other_manager_warning BOOLEAN;
p_spp_delete_warning BOOLEAN;
p_entries_changed_warning VARCHAR2 (200);
p_tax_district_changed_warning BOOLEAN;
p_api_error VARCHAR (4000);
v_organization_id NUMBER;
v_org VARCHAR2 (300);
v_people VARCHAR2 (300);
v_loc NUMBER;
p_business_group_id NUMBER;
v_pay_basis_id NUMBER;
v_payroll_id NUMBER;
BEGIN
p_special_ceiling_step_id := NULL;
FOR rec IN mb_ass
LOOP
BEGIN
SELECT assignment_id, a.effective_start_date,
a.object_version_number --, a.location_id, people_group_id
INTO p_assignment_id, p_effective_date,
p_object_version_number --, v_loc, p_people_group_id
FROM per_all_assignments_f a
WHERE person_id = rec.person_id
AND effective_end_date = TO_DATE ('31/12/4712', 'DD/MM/YYYY');
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;
BEGIN
p_datetrack_update_mode := 'CORRECTION';
p_people_group_id := rec.people_group_id;
hr_assignment_api.update_emp_asg_criteria
(p_effective_date => p_effective_date,
p_datetrack_update_mode => p_datetrack_update_mode,
p_assignment_id => rec.assignment_id,
p_validate => FALSE,
p_called_from_mass_update => NULL,
p_grade_id => rec.grade_id,
p_position_id => rec.position_id,
p_job_id => rec.job_id, --v_job_id,
p_payroll_id => rec.payroll_id,
p_pay_basis_id => rec.main_salary_basis_id,
p_location_id => rec.location_id, --v_loc,
p_organization_id => rec.organization_id,
p_people_group_id => p_people_group_id,
p_object_version_number => p_object_version_number,
p_special_ceiling_step_id => p_special_ceiling_step_id,
p_group_name => p_group_name,
p_effective_start_date => p_effective_start_date,
p_effective_end_date => p_effective_end_date,
p_org_now_no_manager_warning => p_org_now_no_manager_warning,
p_other_manager_warning => p_other_manager_warning,
p_spp_delete_warning => p_spp_delete_warning,
p_entries_changed_warning => p_entries_changed_warning,
p_tax_district_changed_warning => p_tax_district_changed_warning
);
COMMIT;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
p_api_error := NULL;
p_api_error := SQLERRM;
p_people_group_id := NULL;
COMMIT;
END;
END LOOP;
END;