The following lines contain the word 'select', 'insert', 'update' or 'delete':
fnd_file.put_line(fnd_file.log, 'call to delete Applicant Profile Snapshot');
fnd_file.put_line(fnd_file.log, 'List of Applicant Profile Snapshots deleted');
fnd_file.put_line(fnd_file.log, 'call to delete Applicant Document Snapshot');
fnd_file.put_line(fnd_file.log, 'List of Applicant Document Snapshots deleted');
fnd_file.put_line(fnd_file.log, 'call to delete Saved Search Criteria');
fnd_file.put_line(fnd_file.log, 'List of Saved Search Criteria deleted');
fnd_file.put_line(fnd_file.log, 'call to delete Applicant Profile Access');
fnd_file.put_line(fnd_file.log, 'List of Applicant Profile Access deleted');
select aps.profile_snapshot_id, aps.person_id, aps.object_version_number
from irc_apl_profile_snapshots aps
where months_between(sysdate,aps.creation_date) > p_months;
select doc.document_id, doc.type,
doc.person_id, doc.party_id, doc.end_date,
doc.object_version_number
from irc_documents doc
where doc.end_date is not null
and months_between(sysdate,doc.end_date) > p_months;
select iss.saved_search_criteria_id,
iss.vacancy_id, iss.object_version_number
from irc_saved_search_criteria iss
where months_between(sysdate,iss.creation_date) > p_months;
select apa.apl_profile_access_id,
apa.person_id,
apa.object_version_number
from irc_apl_profile_access apa
where months_between(sysdate,apa.creation_date) > p_months;
hr_utility.set_location('Delete Applicant Profile Snapshot:'||l_proc, 20);
irc_apl_prfl_snapshots_api.delete_applicant_snapshot
( p_effective_date => l_effective_date
,p_person_id => rec_apl_profile_snapshot.person_id
,p_profile_snapshot_id => rec_apl_profile_snapshot.profile_snapshot_id
,p_object_version_number => rec_apl_profile_snapshot.object_version_number
);
hr_utility.set_location('Print Delete Snapshot:'||l_proc,25);
hr_utility.set_location('Delete Applicant Document Snapshot:'||l_proc, 30);
irc_document_api.delete_document
( p_effective_date => l_effective_date
,p_document_id => rec_apl_doc_snapshot.document_id
,p_object_version_number => rec_apl_doc_snapshot.object_version_number
,p_person_id => rec_apl_doc_snapshot.person_id
,p_party_id => rec_apl_doc_snapshot.party_id
,p_end_date => rec_apl_doc_snapshot.end_date
,p_type => rec_apl_doc_snapshot.type
,p_purge => l_doc_purge
);
hr_utility.set_location('Print Delete Document:'||l_proc,35);
hr_utility.set_location('Delete Saved Search Criteria:'||l_proc, 40);
irc_saved_search_criteria_api.delete_search_criteria
( p_vacancy_id => rec_saved_search_criteria.vacancy_id
,p_saved_search_criteria_id => rec_saved_search_criteria.saved_search_criteria_id
,p_object_version_number => rec_saved_search_criteria.object_version_number
);
hr_utility.set_location('Print Delete Search Criteria:'||l_proc,45);
hr_utility.set_location('Delete Applicant Profile Access:'||l_proc, 50);
irc_apl_profile_access_api.delete_apl_profile_access
( p_person_id => rec_apl_profile_access.person_id
,p_apl_profile_access_id => rec_apl_profile_access.apl_profile_access_id
,p_object_version_number => rec_apl_profile_access.object_version_number
);
hr_utility.set_location('Print Delete PROFILE ACCESS:'||l_proc,55);