0% found this document useful (0 votes)
332 views

Delete Element Entry API

This procedure deletes element entries for employees. It uses a cursor to select employee numbers, element entry IDs, and effective start dates from various tables where the entry type is 'E' and the effective date is between the employee's start and end dates. For each row fetched, it calls a delete function to remove the element entry, and prints the employee number. Any errors are printed.

Uploaded by

Dhina Karan
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
332 views

Delete Element Entry API

This procedure deletes element entries for employees. It uses a cursor to select employee numbers, element entry IDs, and effective start dates from various tables where the entry type is 'E' and the effective date is between the employee's start and end dates. For each row fetched, it calls a delete function to remove the element entry, and prints the employee number. Any errors are printed.

Uploaded by

Dhina Karan
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

CREATE OR REPLACE PROCEDURE APPS.

delete_element_entries
IS
CURSOR c_comp
IS
SELECT ppf.employee_number,
peef.element_entry_id,
peef.effective_start_date
FROM per_people_f ppf,
per_assignments_f paf,
pay_element_entries_f peef
WHERE peef.entry_type = 'E'
AND ppf.person_id = paf.person_id
and PAF.PRIMARY_FLAG = 'Y'
and PAF.ASSIGNMENT_STATUS_TYPE_ID in (1,2)
--and ppf.employee_number = '146821'
and peef.element_type_id = 312
AND trunc(SYSDATE) BETWEEN ppf.effective_start_date AND ppf.ef
fective_end_date
AND trunc(SYSDATE) BETWEEN paf.effective_start_date AND paf.effective_e
nd_date
AND paf.assignment_id = peef.assignment_id(+);
lc_c_comp c_comp%ROWTYPE;
l_comp_id NUMBER;
l_effective_start_date DATE;
l_effective_end_date DATE;
l_org_id NUMBER;
l_loc_id NUMBER;
l_basis_id NUMBER;
l_ppl_group_id NUMBER;
l_entries_warning BOOLEAN;
BEGIN
OPEN c_comp;
LOOP
FETCH c_comp
INTO lc_c_comp;
EXIT WHEN c_comp%NOTFOUND;
BEGIN
DBMS_OUTPUT.put_line ('Procedure Ran');
hr_entry_api.delete_element_entry
(p_dt_delete_mode => 'ZAP',
p_session_date => lc_c_comp.effective_start
_date,
p_element_entry_id => lc_c_comp.element_entry_i
d
);
DBMS_OUTPUT.put_line (lc_c_comp.employee_number);
END;
l_effective_start_date := NULL;
l_effective_end_date := NULL;
END LOOP;
CLOSE c_comp;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (SUBSTR (SQLERRM, 1, 254));
END;
/

You might also like