DECLARE
CURSOR get_details
IS
SELECT * FROM pay_grade_rules_f;
l_effective_start_date DATE := NULL;
l_effective_end_date DATE := NULL;
l_grade_rule_id NUMBER := NULL;
l_object_version_number NUMBER := NULL;
l_err_msg VARCHAR2 (500) := NULL;
l_rate_id NUMBER := NULL;
BEGIN
FOR i IN get_details
LOOP
BEGIN
hr_grade_rate_value_api.delete_grade_rate_value (
p_validate => FALSE,
p_effective_date => SYSDATE,
p_datetrack_delete_mode => 'ZAP', -- PURGE
p_grade_rule_id => i.grade_rule_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
);
COMMIT;
DBMS_OUTPUT.put_line (
'Grate Rate has been Deleted: ' || i.grade_rule_id
);
EXCEPTION
WHEN OTHERS
THEN
l_err_msg := SQLERRM;
DBMS_OUTPUT.put_line ('Inner Exception: ' || l_err_msg);
END;
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
l_err_msg := SQLERRM;
DBMS_OUTPUT.put_line ('Main Exception: ' || l_err_msg);
END;
No comments:
Post a Comment