This document contains SQL scripts to update reservation and demand records in the MTL_RESERVATIONS and MTL_DEMAND tables to fix incorrectly set demand source header IDs that were created with zero demand headers. The scripts set the DEMAND_SOURCE_HEADER_ID to a non-zero value retrieved from the OE_ORDER_LINES_ALL table and updates the LAST_UPDATED_BY field.
This document contains SQL scripts to update reservation and demand records in the MTL_RESERVATIONS and MTL_DEMAND tables to fix incorrectly set demand source header IDs that were created with zero demand headers. The scripts set the DEMAND_SOURCE_HEADER_ID to a non-zero value retrieved from the OE_ORDER_LINES_ALL table and updates the LAST_UPDATED_BY field.
This document contains SQL scripts to update reservation and demand records in the MTL_RESERVATIONS and MTL_DEMAND tables to fix incorrectly set demand source header IDs that were created with zero demand headers. The scripts set the DEMAND_SOURCE_HEADER_ID to a non-zero value retrieved from the OE_ORDER_LINES_ALL table and updates the LAST_UPDATED_BY field.
PROMPT INV9-datafix.sql PROMPT From Note:1471942.1 Inventory Standard Datafix Instruction #9: Fixing Sales Order reservations created with Zero demand header PROMPT
PROMPT UPDATING MTL_RESERVATIONS WITH CORRECT DEMAND_SOURCE_HEADER_ID
UPDATE MTL_RESERVATIONS MR SET DEMAND_SOURCE_HEADER_ID = NVL((SELECT inv_salesorder.get_salesorder_for_oeheader(HEADER_ID) FROM OE_ORDER_LINES_ALL WHERE LINE_ID = MR.DEMAND_SOURCE_LINE_ID), 0), LAST_UPDATED_BY = -2471362 WHERE DEMAND_SOURCE_TYPE_ID IN (2,8) AND NVL(DEMAND_SOURCE_HEADER_ID, 0) = 0 AND SUPPLY_SOURCE_TYPE_ID = 13;
PROMPT UPDATING MTL_DEMAND WITH CORRECT DEMAND_SOURCE_HEADER_ID
UPDATE MTL_DEMAND MD SET DEMAND_SOURCE_HEADER_ID = NVL((SELECT inv_salesorder.get_salesorder_for_oeheader(HEADER_ID) FROM OE_ORDER_LINES_ALL WHERE LINE_ID = MD.DEMAND_SOURCE_LINE), 0), LAST_UPDATED_BY = -2471362 WHERE DEMAND_SOURCE_TYPE IN (2,8) AND NVL(DEMAND_SOURCE_HEADER_ID, 0) = 0 AND NVL(SUPPLY_SOURCE_TYPE, 13) = 13;