The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT zone_id
BULK COLLECT INTO l_original_zone_ids
FROM icx_cat_content_zones_b
WHERE type='LOCAL'
AND category_attribute_action_flag='INCLUDE'
AND sqe_sequence IS NULL;
l_new_zone_ids.DELETE;
l_zone_categories.DELETE;
delete_old_zone(l_original_zone_ids(i));
SELECT ip_category_id
BULK COLLECT INTO l_category_list
FROM icx_cat_zone_secure_attributes
WHERE ZONE_ID=p_original_zone_id
AND SECURING_ATTRIBUTE= 'CATEGORY';
l_zone_categories.DELETE;
INSERT INTO icx_cat_content_zones_b
(zone_id, type, url, security_assignment_flag,
category_attribute_action_flag, supplier_attribute_action_flag,
items_without_supplier_flag, items_without_shop_catg_flag,
created_by, creation_date, last_updated_by,
last_update_date, last_update_login)
SELECT p_new_zone_ids(i), zones.type, zones.url, zones.security_assignment_flag,
zones.category_attribute_action_flag, zones.supplier_attribute_action_flag,
zones.items_without_supplier_flag, zones.items_without_shop_catg_flag,
zones.created_by, zones.creation_date, zones.last_updated_by,
zones.last_update_date, zones.last_update_login
FROM icx_cat_content_zones_b zones
WHERE zones.zone_id = p_old_zone_id;
INSERT INTO icx_cat_content_zones_tl
(zone_id, language, source_lang, name, description, keywords, image,
created_by, creation_date, last_updated_by, last_update_date,
last_update_login)
SELECT p_new_zone_ids(i), zones_tl.language, zones_tl.source_lang, zones_tl.name || ' : ' || l_index_tab(i),
zones_tl.description, zones_tl.keywords, zones_tl.image,
zones_tl.created_by, zones_tl.creation_date, zones_tl.last_updated_by, zones_tl.last_update_date,
zones_tl.last_update_login
FROM icx_cat_content_zones_tl zones_tl
WHERE zones_tl.zone_id = p_old_zone_id;
INSERT INTO icx_cat_zone_secure_attributes
(zone_id, securing_attribute, supplier_id, created_by, creation_date,
last_updated_by, last_update_date, last_update_login)
SELECT p_new_zone_ids(i), zone_attr.securing_attribute, zone_attr.supplier_id,
zone_attr.created_by, zone_attr.creation_date,
zone_attr.last_updated_by, zone_attr.last_update_date, zone_attr.last_update_login
FROM icx_cat_zone_secure_attributes zone_attr
WHERE zone_attr.zone_id = p_old_zone_id
AND zone_attr.securing_attribute = 'SUPPLIER';
INSERT INTO icx_cat_zone_secure_attributes
(zone_id, securing_attribute, ip_category_id, created_by, creation_date,
last_updated_by, last_update_date, last_update_login)
SELECT p_new_zone_ids(i), 'CATEGORY', p_zone_categories(p_new_zone_ids(i))(j),
fnd_global.user_id, sysdate, fnd_global.user_id, sysdate,
fnd_global.login_id
FROM dual;
INSERT INTO icx_cat_secure_contents
(content_id, org_id, responsibility_id, secure_by, created_by, creation_date,
last_updated_by, last_update_date, last_update_login)
SELECT p_new_zone_ids(i), contents.org_id, contents.responsibility_id,
contents.secure_by, contents.created_by, contents.creation_date,
contents.last_updated_by, contents.last_update_date, contents.last_update_login
FROM icx_cat_secure_contents contents
WHERE contents.content_id = p_old_zone_id;
INSERT INTO icx_cat_store_contents
(store_id, content_id, content_type, sequence, display_always_flag,
created_by, creation_date, last_updated_by, last_update_date,
last_update_login)
SELECT sc.store_id, p_new_zone_ids(i), sc.content_type, sc.sequence,
sc.display_always_flag, sc.created_by, sc.creation_date,
sc.last_updated_by, sc.last_update_date, sc.last_update_login
FROM icx_cat_store_contents sc
WHERE sc.content_id = p_old_zone_id;
PROCEDURE delete_old_zone(p_old_zone_id IN NUMBER) IS
l_api_name CONSTANT VARCHAR2(30) := 'delete_old_zone';
DELETE icx_cat_store_contents
WHERE content_id = p_old_zone_id;
DELETE icx_cat_secure_contents
WHERE content_id = p_old_zone_id;
DELETE icx_cat_zone_secure_attributes
WHERE zone_id=p_old_zone_id;
DELETE icx_cat_content_zones_tl
WHERE zone_id=p_old_zone_id;
DELETE icx_cat_content_zones_b
WHERE zone_id=p_old_zone_id;
END delete_old_zone;