Sunday, September 6, 2015

API to Delete Approver Group Items

DECLARE
   CURSOR c1
   IS
      SELECT *
        FROM ame_approval_group_items
       WHERE approval_group_id = 15001
             AND SYSDATE BETWEEN start_date AND end_date;

   l_start_date   DATE := NULL;
   l_end_date     DATE := NULL;
BEGIN
   FOR i IN c1
   LOOP
      ame_approver_group_api.
       delete_approver_group_item (
         p_validate                 => FALSE,
         p_approval_group_item_id   => i.approval_group_item_id,
         p_object_version_number    => i.object_version_number,
         p_start_date               => l_start_date,
         p_end_date                 => l_end_date);

      DBMS_OUTPUT.
       put_line (i.approval_group_item_id || ' has been deleted !!!');
   END LOOP;
END;



--select * from ame_approval_groups where name  = 'AZHD AP Approval'

No comments:

Post a Comment