DECLARE
CURSOR c1
IS
SELECT *
FROM ota_category_usages
WHERE business_group_id = 1107;
BEGIN
FOR i IN c1
LOOP
BEGIN
OTA_CATEGORY_USAGE_API.
DELETE_CATEGORY (
p_validate => FALSE,
p_category_usage_id => i.category_usage_id,
p_object_version_number => i.object_version_number);
COMMIT;
DBMS_OUTPUT.put_line (i.category_usage_id || ' has been deleted ');
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.
put_line (
'Inner Exception: ' || SQLERRM || ' - ' || i.category_usage_id);
END;
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Main Exception: ' || SQLERRM);
END;
No comments:
Post a Comment