1507: and sli.organization_id = si.organization_id
1508: and sli.secondary_locator is not NULL)
1509: and si.set_id = TO_CHAR(to_number(USERENV('SESSIONID')));
1510:
1511: /* Copy cross references into MTL_CROSS_REFERENCES table */
1512: table_name := 'MTL_CROSS_REFERENCES table';
1513: insert into mtl_cross_references
1514: (
1515: inventory_item_id,
1508: and sli.secondary_locator is not NULL)
1509: and si.set_id = TO_CHAR(to_number(USERENV('SESSIONID')));
1510:
1511: /* Copy cross references into MTL_CROSS_REFERENCES table */
1512: table_name := 'MTL_CROSS_REFERENCES table';
1513: insert into mtl_cross_references
1514: (
1515: inventory_item_id,
1516: organization_id,
1509: and si.set_id = TO_CHAR(to_number(USERENV('SESSIONID')));
1510:
1511: /* Copy cross references into MTL_CROSS_REFERENCES table */
1512: table_name := 'MTL_CROSS_REFERENCES table';
1513: insert into mtl_cross_references
1514: (
1515: inventory_item_id,
1516: organization_id,
1517: cross_reference_type,
1544: prg_appid, /* program_application_id */
1545: prg_id, /* program_id */
1546: SYSDATE /* program_update_date */
1547: from
1548: mtl_cross_references_interface cri,
1549: mtl_system_items_interface si
1550: where (si.organization_id = cri.organization_id or
1551: cri.organization_id is NULL)
1552: and si.inventory_item_id = cri.inventory_item_id
1555: and org_independent_flag is not NULL
1556: and si.set_id = TO_CHAR(to_number(USERENV('SESSIONID')));
1557:
1558:
1559: insert into mtl_cross_references
1560: (
1561: inventory_item_id,
1562: organization_id,
1563: cross_reference_type,
1590: prg_appid, /* program_application_id */
1591: prg_id, /* program_id */
1592: SYSDATE /* program_update_date */
1593: from
1594: mtl_cross_references cr,
1595: mtl_system_items_interface si
1596: where (si.organization_id = cr.organization_id or
1597: cr.organization_id is NULL)
1598: and si.copy_item_id = cr.inventory_item_id
1596: where (si.organization_id = cr.organization_id or
1597: cr.organization_id is NULL)
1598: and si.copy_item_id = cr.inventory_item_id
1599: and not exists (select NULL
1600: from mtl_cross_references_interface cri
1601: where cri.inventory_item_id = si.inventory_item_id
1602: and cri.organization_id = si.organization_id
1603: and cri.cross_reference_type is not NULL
1604: and cri.cross_reference is not NULL
1648: where si.inventory_item_id = li2.inventory_item_id
1649: and si.organization_id = li2.organization_id
1650: and si.set_id = TO_CHAR(to_number(USERENV('SESSIONID'))));
1651:
1652: table_name := 'MTL_CROSS_REFERENCES_INTERFACE';
1653: delete from MTL_CROSS_REFERENCES_INTERFACE ri
1654: where rowid in ( select ri2.rowid
1655: from MTL_CROSS_REFERENCES_INTERFACE ri2,
1656: MTL_SYSTEM_ITEMS_INTERFACE si
1649: and si.organization_id = li2.organization_id
1650: and si.set_id = TO_CHAR(to_number(USERENV('SESSIONID'))));
1651:
1652: table_name := 'MTL_CROSS_REFERENCES_INTERFACE';
1653: delete from MTL_CROSS_REFERENCES_INTERFACE ri
1654: where rowid in ( select ri2.rowid
1655: from MTL_CROSS_REFERENCES_INTERFACE ri2,
1656: MTL_SYSTEM_ITEMS_INTERFACE si
1657: where si.inventory_item_id = ri2.inventory_item_id
1651:
1652: table_name := 'MTL_CROSS_REFERENCES_INTERFACE';
1653: delete from MTL_CROSS_REFERENCES_INTERFACE ri
1654: where rowid in ( select ri2.rowid
1655: from MTL_CROSS_REFERENCES_INTERFACE ri2,
1656: MTL_SYSTEM_ITEMS_INTERFACE si
1657: where si.inventory_item_id = ri2.inventory_item_id
1658: and (si.organization_id = ri2.organization_id or
1659: ri2.organization_id is NULL)