The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT NVL(new_schedule_quantity,0)
FROM mrp_sales_order_updates u
WHERE u.sales_order_id = p_demand_id
AND u.process_status = 5;
SELECT new_schedule_date
FROM mrp_sales_order_updates u
WHERE u.sales_order_id = p_demand_id
AND u.process_status = 5;
SELECT DECODE(visible_demand_flag,'Y',1,2)
FROM oe_order_lines_all oe
WHERE line_id = p_demand_id;
FUNCTION updated_flag(p_demand_id IN NUMBER) RETURN NUMBER IS
CURSOR GET_UPDATED_FLAG IS
SELECT '2'
FROM mtl_demand_om_view demand
WHERE ((EXISTS
(SELECT NULL
FROM mrp_sales_order_updates updates
WHERE updates.sales_order_id = demand.demand_id
AND updates.old_schedule_date = demand.requirement_date
AND updates.old_schedule_quantity = demand.primary_uom_quantity
AND updates.previous_customer_id = demand.customer_id
AND updates.previous_ship_id = demand.ship_to_site_use_id
AND updates.previous_bill_id = demand.bill_to_site_use_id
AND NVL(updates.current_demand_class, 'A') =
NVL(demand.demand_class, 'A')
AND updates.process_status <> IN_PROCESS))
OR demand.demand_source_type NOT IN
(MTL_SALES_ORDER, MTL_INT_SALES_ORDER)
OR demand.customer_id IS NULL
OR demand.ship_to_site_use_id IS NULL
OR demand.bill_to_site_use_id IS NULL)
AND demand.demand_id = p_demand_id
AND demand.parent_demand_id IS NULL;
l_updated_flag NUMBER := 1;
OPEN GET_UPDATED_FLAG;
FETCH GET_UPDATED_FLAG into l_updated_flag;
CLOSE GET_UPDATED_FLAG;
RETURN l_updated_flag;
END updated_flag;
SELECT DECODE(visible_demand_flag,'Y',1,2)
FROM oe_order_lines_all oe
WHERE line_id = p_demand_id;
SELECT SUM(NVL(MD1.PRIMARY_UOM_QUANTITY,0))
INTO total_reservation_quantity
FROM mtl_demand MD1
WHERE
MD1.DEMAND_SOURCE_LINE = to_char(p_demand_id)
AND NVL(MD1.DEMAND_SOURCE_TYPE,2) IN (2,8,12)
AND NVL(MD1.RESERVATION_TYPE,2) IN (2,3);