There are scenarios where we are need to delete the element entries created. Here is sample script which can be used to delete(i.e purge, Date track delete mode as ‘ZAP’) entries on the Oracle system
Step1: Get the Element Type Id from below select
select * from pay_element_types_f
where element_name like ‘Test Element1’;
— Element Type ID: 587
Step2: Sample Anonymous block for purging the element entries
DECLARE
CURSOR c1
IS
SELECT *
FROM pay_element_entries_f
WHERE element_type_id = 587;
l_effective_start_date DATE;
l_effective_end_date DATE;
l_delete_warning BOOLEAN;
BEGIN
FOR i IN c1
LOOP
pay_element_entry_api.delete_element_entry (
p_validate => FALSE,
p_datetrack_delete_mode => ‘ZAP’,
p_effective_date => i.effective_start_date,
p_element_entry_id => i.element_entry_id,
p_object_version_number => i.object_version_number,
p_effective_start_date => l_effective_start_date,
p_effective_end_date => l_effective_end_date,
p_delete_warning => l_delete_warning);
END LOOP;
END;
Step3: Verify the entries purged by running the below select
SELECT *
FROM pay_element_entries_f
WHERE element_type_id = 587;
— The result of the above select should be zero records after purging the records.
Step4: After validation , Commit;