1041: and M.ELEMENT_NAME = V.ELEMENT_NAME; /* This where clause was */
1042: /* originally an outer join */
1043:
1044:
1045: /* Copy item categories into MTL_ITEM_CATEGORIES table */
1046: table_name := 'MTL_ITEM_CATEGORIES';
1047: insert into MTL_ITEM_CATEGORIES
1048: ( inventory_item_id,
1049: category_set_id,
1042: /* originally an outer join */
1043:
1044:
1045: /* Copy item categories into MTL_ITEM_CATEGORIES table */
1046: table_name := 'MTL_ITEM_CATEGORIES';
1047: insert into MTL_ITEM_CATEGORIES
1048: ( inventory_item_id,
1049: category_set_id,
1050: category_id,
1043:
1044:
1045: /* Copy item categories into MTL_ITEM_CATEGORIES table */
1046: table_name := 'MTL_ITEM_CATEGORIES';
1047: insert into MTL_ITEM_CATEGORIES
1048: ( inventory_item_id,
1049: category_set_id,
1050: category_id,
1051: last_update_date,
1074: SYSDATE, /* program_update_date */
1075: MP1.organization_id
1076: from MTL_PARAMETERS MP1,
1077: MTL_PARAMETERS MP2,
1078: mtl_item_categories_interface ici,
1079: mtl_system_items_interface si
1080: where si.inventory_item_id = ici.inventory_item_id
1081: and si.organization_id = ici.organization_id
1082: and ici.category_set_id is not NULL
1086: and ((si.ORGANIZATION_ID = MP1.ORGANIZATION_ID) OR
1087: (MP1.ORGANIZATION_ID = MP2.master_organization_id) OR
1088: (MP1.ORGANIZATION_ID = validation_org ));
1089:
1090: insert into MTL_ITEM_CATEGORIES
1091: ( inventory_item_id,
1092: category_set_id,
1093: category_id,
1094: last_update_date,
1116: prg_id, /* program_id */
1117: SYSDATE, /* program_update_date */
1118: MP1.organization_id
1119: from
1120: mtl_item_categories ic,
1121: MTL_PARAMETERS MP1,
1122: MTL_PARAMETERS MP2,
1123: mtl_system_items_interface si
1124: where si.copy_item_id = ic.inventory_item_id
1124: where si.copy_item_id = ic.inventory_item_id
1125: and si.organization_id = ic.organization_id
1126: and MP2.organization_id = si.organization_id
1127: and not exists ( select NULL
1128: from mtl_item_categories_interface ici
1129: where ici.inventory_item_id = si.inventory_item_id
1130: and ici.organization_id = si.organization_id
1131: and ici.category_set_id is not NULL
1132: and ici.category_id is not NULL)
1612: MTL_SYSTEM_ITEMS_INTERFACE si
1613: where si.inventory_item_id = di2.inventory_item_id
1614: and si.set_id = TO_CHAR(to_number(USERENV('SESSIONID'))));
1615:
1616: table_name := 'MTL_ITEM_CATEGORIES_INTERFACE';
1617: delete from MTL_ITEM_CATEGORIES_INTERFACE ci
1618: where ci.rowid in ( select ci2.rowid
1619: from MTL_ITEM_CATEGORIES_INTERFACE ci2,
1620: MTL_SYSTEM_ITEMS_INTERFACE si
1613: where si.inventory_item_id = di2.inventory_item_id
1614: and si.set_id = TO_CHAR(to_number(USERENV('SESSIONID'))));
1615:
1616: table_name := 'MTL_ITEM_CATEGORIES_INTERFACE';
1617: delete from MTL_ITEM_CATEGORIES_INTERFACE ci
1618: where ci.rowid in ( select ci2.rowid
1619: from MTL_ITEM_CATEGORIES_INTERFACE ci2,
1620: MTL_SYSTEM_ITEMS_INTERFACE si
1621: where si.inventory_item_id = ci2.inventory_item_id
1615:
1616: table_name := 'MTL_ITEM_CATEGORIES_INTERFACE';
1617: delete from MTL_ITEM_CATEGORIES_INTERFACE ci
1618: where ci.rowid in ( select ci2.rowid
1619: from MTL_ITEM_CATEGORIES_INTERFACE ci2,
1620: MTL_SYSTEM_ITEMS_INTERFACE si
1621: where si.inventory_item_id = ci2.inventory_item_id
1622: and si.organization_id = ci2.organization_id
1623: and si.set_id = TO_CHAR(to_number(USERENV('SESSIONID'))));