DECLARE
CURSOR c1
IS
SELECT *
FROM hr_all_organization_units
WHERE organization_id = 226; -- Input as Organization ID one wants to Delete
BEGIN
FOR i IN c1
LOOP
BEGIN
hr_organization_api.delete_organization (
p_validate => FALSE,
p_organization_id => i.organization_id,
p_object_version_number => i.object_version_number
);
DBMS_OUTPUT.put_line ('Organization has been Deleted !!!');
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Inner Exception: ' || SQLERRM);
END;
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);
END;
No comments:
Post a Comment