The following lines contain the word 'select', 'insert', 'update' or 'delete':
gRtCategoryIds.DELETE;
gCategoryKeys.DELETE;
gCategoryTypes.DELETE;
gRtItemIds.DELETE;
PROCEDURE deleteCategories IS
CURSOR cCatItems(p_rt_category_id IN NUMBER) IS
SELECT rt_item_id
FROM icx_cat_category_items
WHERE rt_category_id = p_rt_category_id;
ICX_POR_EXT_UTL.debug('Delete from ICX_POR_CATEGORY_DATA_SOURCES');
DELETE FROM icx_por_category_data_sources
WHERE category_key = gCategoryKeys(i)
AND external_source = 'Oracle';
ICX_POR_EXT_UTL.debug('Delete from ICX_POR_CATEGORY_ORDER_MAP');
DELETE FROM icx_por_category_order_map
WHERE rt_category_id = gRtCategoryIds(i)
AND external_source = 'Oracle';
ICX_POR_EXT_UTL.debug('Delete from ICX_POR_TABLE_OF_CONTENTS_TL');
DELETE FROM icx_por_table_of_contents_tl
WHERE child = gRtCategoryIds(i);
xRtItemIds.DELETE;
ICX_POR_DELETE_CATALOG.setCommitSize(ICX_POR_EXT_UTL.gCommitSize);
ICX_POR_DELETE_CATALOG.deleteCommonTables(xRtItemIds,
ICX_POR_DELETE_CATALOG.CATITEM_TABLE_LAST);
ICX_POR_EXT_UTL.debug('Delete from ICX_CAT_CATEGORY_ITEMS');
DELETE FROM icx_cat_category_items
WHERE rt_item_id = xRtItemIds(j)
AND rt_category_id = gRtCategoryIds(i);
ICX_POR_EXT_UTL.debug('Delete from ICX_CAT_CATEGORIES_TL');
DELETE FROM icx_cat_categories_tl
WHERE rt_category_id = gRtCategoryIds(i);
ICX_POR_EXT_UTL.pushError('ICX_POR_EXT_PURGE.deleteCategories-'||
xErrLoc||' '||SQLERRM);
END deleteCategories;
procedure deleteItems IS
xErrLoc PLS_INTEGER := 100;
ICX_POR_DELETE_CATALOG.setCommitSize(ICX_POR_EXT_UTL.gCommitSize);
ICX_POR_DELETE_CATALOG.deleteCommonTables(gRtItemIds,
ICX_POR_DELETE_CATALOG.ITEM_TABLE_LAST);
ICX_POR_EXT_UTL.pushError('ICX_POR_EXT_PURGE.deleteItems-'||
xErrLoc||' '||SQLERRM);
end deleteItems;
deleteCategories;
deleteItems;
SELECT category_set_id,
validate_flag,
structure_id
INTO xCategorySetId,
xValidateFlag,
xStructureId
FROM mtl_default_sets_view
WHERE functional_area_id = 2;
'SELECT cat.rt_category_id, cat.key, cat.type ' ||
'FROM icx_cat_categories_tl cat ' ||
'WHERE title = ''Oracle'' ' ||
'AND language = ''' || ICX_POR_EXTRACTOR.gBaseLang || ''' ' ||
'AND ((type = '||ICX_POR_EXT_CLASS.TEMPLATE_HEADER_TYPE||' AND '||
' NOT EXISTS (SELECT ''active template header'' ';
' NOT EXISTS (SELECT ''active oracle category'' ';
'AND cat.last_updated_by = '||ICX_POR_EXT_TEST.TEST_USER_ID;
SELECT cat.rt_category_id, cat.key, cat.type
FROM icx_cat_categories_tl cat
WHERE cat.title = 'Oracle'
AND cat.language = ICX_POR_EXTRACTOR.gBaseLang
AND NOT EXISTS (SELECT 'Bulkloaded items'
FROM icx_cat_items_b i,
icx_cat_category_items ci
WHERE ci.rt_category_id = cat.rt_category_id
AND ci.rt_item_id = i.rt_item_id
AND NVL(i.extractor_updated_flag, 'N') = 'N');
SELECT cat.rt_category_id, cat.key, cat.type
FROM icx_cat_categories_tl cat
WHERE cat.title = 'Oracle'
AND cat.language = ICX_POR_EXTRACTOR.gBaseLang
AND key = to_char(pInvCatId)
AND NOT EXISTS (SELECT 'Bulkloaded items'
FROM icx_cat_items_b i,
icx_cat_category_items ci
WHERE ci.rt_category_id = cat.rt_category_id
AND ci.rt_item_id = i.rt_item_id
AND NVL(i.extractor_updated_flag, 'N') = 'N');
xRtCategoryIds.DELETE;
xKeys.DELETE;
xTypes.DELETE;
'Total deleted categories: ' || gCompletedCount);
IF (pType = 'DELETED_ITEMS') THEN
xErrLoc := 240;
'SELECT i.rt_item_id ' ||
'FROM icx_cat_items_b i ' ||
'WHERE i.extractor_updated_flag = ''Y'' ' ||
'AND i.internal_item_id is not null ';
'AND i.last_updated_by = '||ICX_POR_EXT_TEST.TEST_USER_ID||' ';
'AND NOT EXISTS (SELECT ''item deleted from item master'' ';
'SELECT i.rt_item_id ' ||
'FROM icx_cat_items_b i, ' ||
'icx_cat_item_prices p1 ' ||
'WHERE i.extractor_updated_flag = ''Y'' ' ||
'AND i.internal_item_id is not null ';
'AND i.last_updated_by = '||ICX_POR_EXT_TEST.TEST_USER_ID||' ';
'AND NOT EXISTS (SELECT ''Invalid item category association'' ';
SELECT i.rt_item_id
FROM icx_cat_items_b i
WHERE i.extractor_updated_flag = 'Y';
SELECT distinct i.rt_item_id
FROM icx_cat_items_b i,
icx_cat_item_prices p
WHERE p.mtl_category_id = pInvCatItemId
AND p.rt_item_id = i.rt_item_id
AND i.extractor_updated_flag = 'Y';
SELECT i.rt_item_id
FROM icx_cat_items_b i
WHERE i.internal_item_id = pInvCatItemId
AND i.extractor_updated_flag = 'Y';
xRtItemIds.DELETE;
'Total deleted items: ' || gCompletedCount);
openItemCursor(pMode, pInvCatItemId, 'DELETED_ITEMS', cItem);
'Purge items deleted from item masters');