The following lines contain the word 'select', 'insert', 'update' or 'delete':
g_RunUpdateMode_profile constant varchar2(30) := 'HR_APL_UPD_RUN_MODE';
g_updateName constant varchar2(30) := 'HRAPLUPD1';
SELECT application_id, date_end, person_id, object_version_number
,date_received, business_group_id
FROM per_applications appl
WHERE appl.rowid between p_start_rowid and p_end_rowid
AND date_end IS NOT NULL
AND EXISTS
(SELECT 'Y'
FROM per_all_assignments_f paf
WHERE paf.application_id = appl.application_id
AND paf.assignment_type = 'A'
AND paf.effective_end_date > appl.date_end)
ORDER BY date_end DESC;
SELECT person_id, full_name, applicant_number,object_version_number
FROM per_all_people_f
WHERE person_id = cp_person_id
AND (effective_start_date > cp_termination_date
OR
cp_termination_date between effective_start_date
and effective_end_date)
for update nowait;
SELECT null
FROM per_person_type_usages_f ptu
,per_person_types ppt
WHERE person_id = cp_person_id
AND (effective_start_date > cp_termination_date
OR
cp_termination_date between effective_start_date
and effective_end_date)
AND ptu.person_type_id = ppt.person_type_id
AND ppt.system_person_type in ('APL','EX_APL')
for update of ptu.person_type_id nowait; -- #4919613
SELECT count(assignment_id)
FROM per_all_assignments_f paf
WHERE paf.application_id = p_application_id
AND paf.assignment_type = 'A'
AND paf.effective_end_date > p_termination_date
AND paf.effective_end_date <> hr_general.end_of_time
AND paf.effective_start_date =
(select max(effective_start_date) -- do not consider DT updates
from per_all_assignments_f paf2
where paf2.assignment_id = paf.assignment_id
and paf2.effective_end_date > p_termination_date);
SELECT count(assignment_id)
FROM per_all_assignments_f paf
WHERE paf.application_id = p_application_id
AND paf.assignment_type = 'A'
AND paf.effective_end_date > p_termination_date
AND paf.effective_start_date =
(select max(effective_start_date) -- do not consider DT updates
from per_all_assignments_f paf2
where paf2.assignment_id = paf.assignment_id
and paf2.effective_end_date > p_termination_date);
hr_utility.trace(' 30: update person and ptu records');
hr_applicant_internal.Update_PER_PTU_Records
(p_business_group_id => l_appl_rec.business_group_id
,p_person_id => l_appl_rec.person_id
,p_effective_date => l_appl_rec.date_received
,p_applicant_number => l_person_rec.applicant_number
,p_APL_person_type_id => null
,p_per_effective_start_date => l_validation_start_date
,p_per_effective_end_date => l_validation_end_date
,p_per_object_version_number => l_per_object_version_number --bug 4095315
);
hr_utility.trace(' 40: update application');
if RunUpdateMode = g_ADPatchRunMode then
--
IF l_count = 4 then
l_continue_process := FALSE;
if RunUpdateMode = g_ADPatchRunMode then
--
-- Fix for bug 4205784.comment out the following code.
--
--raise;
PROCEDURE Update_APL_using_LTU
(errbuf OUT nocopy varchar2
,retcode OUT nocopy number
,p_this_worker IN number
,p_total_workers IN number
,p_table_owner IN varchar2
,p_table_name IN varchar2
,p_update_name IN varchar2
,p_batchsize IN number)
IS
l_any_rows_to_process boolean;
ad_parallel_updates_pkg.initialize_rowid_range(
ad_parallel_updates_pkg.ROWID_RANGE,
p_table_owner,
p_table_name,
p_update_name,
p_this_worker,
p_total_workers,
p_batchsize, 0);
ad_parallel_updates_pkg.get_rowid_range(
l_start_rowid,
l_end_rowid,
l_any_rows_to_process,
p_batchsize,
TRUE);
ad_parallel_updates_pkg.processed_rowid_range(
l_rows_processed,
l_end_rowid);
ad_parallel_updates_pkg.get_rowid_range(
l_start_rowid,
l_end_rowid,
l_any_rows_to_process,
p_batchsize,
FALSE);
END Update_APL_using_LTU;
PROCEDURE Update_APL_inCM_Manager
(p_errbuf out nocopy varchar2
,p_retcode out nocopy varchar2
,X_batch_size in number
,X_Num_Workers in number
,p_process_All in varchar2
,p_caller in varchar2 -- MB: Move parameter up so it occurs before
-- optional parameters.
,p_apl_id in number default 0
--,p_caller in varchar2
) IS
--
cursor csr_get_apl_rowid(cp_apl_id number) is
select rowid
from per_applications
where application_id = cp_apl_id;
l_update_name varchar2(30);
l_update_name := g_updateName; -- this matches name used in ADPATCH script
fnd_file.put_line(FND_FILE.LOG, ' UpdateName : '||l_update_name);
hr_update_utility.setUpdateProcessing(p_update_name => l_update_name);
hr_update_utility.setUpdateComplete(p_update_name => l_update_name);
** a manual submission delete the PAY_UPGRADE_STATUS record.
*/
if p_caller = 'F' then
delete from pay_upgrade_status
where upgrade_definition_id =
(select upgrade_definition_id
from pay_upgrade_definitions
where short_name = l_update_name);
fnd_file.put_line(FND_FILE.LOG,' ** Upgrade Status row deleted successfully **');
l_update_name := l_update_name||'_'||to_char(sysdate,'DDMMRRHH24MISS');
X_Argument6 => l_update_name,
X_Argument7 => p_apl_id
);
END Update_APL_inCM_Manager;
PROCEDURE Update_APL_inCM_Worker
(p_errbuf out nocopy varchar2
,p_retcode out nocopy varchar2
,X_batch_size in number
,X_Worker_Id in number
,X_Num_Workers in number
,p_process_All in varchar2
,p_caller in varchar2 -- Move parameter up so it occurs before
-- optional parameters.
,p_updateName in varchar2
,p_apl_id in number default 0
--,p_caller in varchar2
) IS
--
cursor csr_get_apl_rowid(cp_apl_id number) is
select rowid
from per_applications
where application_id = cp_apl_id;
fnd_file.put_line(FND_FILE.LOG, ' updateName : '||p_updateName);
hr_applicant_dataupd.Update_APL_using_LTU
(errbuf => p_errbuf
,retcode => p_retcode
,p_this_worker => X_worker_id
,p_total_workers => X_num_workers
,p_table_owner => l_table_owner
,p_table_name => l_table_name
,p_update_name => p_updateName
,p_batchsize => X_batch_size);
END Update_APL_inCM_Worker;
l_result := hr_update_utility.isUpdateComplete
(p_app_shortname => g_concProgramName
,p_function_name => null
,p_business_group_id => null
,p_update_name => g_updateName);
FUNCTION RunUpdateMode RETURN varchar2 IS
--
l_value varchar2(100);
l_value := FND_PROFILE.value(g_RunUpdateMode_profile);
END RunUpdateMode;
return(RunUpdateMode = g_ADPatchRunMode);
return(RunUpdateMode = g_CMRunMode);