The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT WIAS.Activity_Status
INTO l_activity_status
FROM wf_item_activity_statuses WIAS,
wf_process_activities WPA
WHERE WIAS.Process_Activity = WPA.instance_id
AND WPA.activity_name = 'EXPORT_COMPLIANCE_ELIGIBLE'
AND WIAS.item_type = 'OEOL'
AND WIAS.item_key = to_char(p_line_id)
AND WIAS.activity_status = 'NOTIFIED' ;
SELECT -- MOAC_SQL_CHANGE
L.line_id , L.org_id
FROM oe_order_lines L
,oe_order_headers_all H
,mtl_system_items MSI
WHERE L.header_id = H.header_id
AND L.inventory_item_id = MSI.inventory_item_id
AND L.ship_from_org_id = MSI.organization_id
AND H.order_number >= NVL(cp_order_num_low,
H.order_number)
AND H.order_number <= NVL(cp_order_num_high,
H.order_number)
AND NVL(H.sold_to_org_id,-99) = NVL(cp_customer,
NVL(H.sold_to_org_id,-99))
AND NVL(H.cust_po_number,-99) = NVL(cp_customer_po_num,
NVL(H.cust_po_number,-99))
AND H.order_type_id = NVL(cp_order_type,
H.order_type_id)
AND NVL(L.ship_from_org_id,-99) = NVL(cp_warehouse,
NVL(L.ship_from_org_id,-99))
AND NVL(L.ship_to_org_id,-99) = NVL(cp_ship_to_location,
NVL(L.ship_to_org_id,-99))
AND L.inventory_item_id = NVL(cp_inventory_item_id,
L.inventory_item_id)
AND L.schedule_ship_date >= NVL(cp_schedule_date_low,
L.schedule_ship_date)
AND L.schedule_ship_date <= NVL(cp_schedule_date_high,
L.schedule_ship_date)
AND H.ordered_date >= NVL(cp_ordered_date_low,
H.ordered_date)
AND H.ordered_date <= NVL(cp_ordered_date_high,
H.ordered_date)
AND H.open_flag = 'Y' --for 3631462
AND L.open_flag = 'Y' --for 3631462
ORDER BY H.org_id, H.header_id;
SELECT
FND_DATE.Canonical_To_Date(p_schedule_date_low),
FND_DATE.Canonical_To_Date(p_schedule_date_high),
FND_DATE.Canonical_To_Date(p_ordered_date_low),
FND_DATE.Canonical_To_Date(p_ordered_date_high)
INTO
l_schedule_date_low,
l_schedule_date_high,
l_ordered_date_low,
l_ordered_date_high
FROM DUAL;
l_sql_stmt := 'SELECT L.line_id, L.org_id '||
'FROM oe_order_lines L, oe_order_headers_all H, '||
'wf_item_activity_statuses WIAS, wf_process_activities WPA ' ||
'WHERE L.header_id = H.header_id '||
'AND WIAS.item_key = to_char(L.line_id) '||
'AND WIAS.Process_Activity = WPA.instance_id '||
'AND WPA.activity_name = ''EXPORT_COMPLIANCE_ELIGIBLE'' '||
'AND WIAS.item_type = ''OEOL'' ' ||
'AND WIAS.activity_status = ''NOTIFIED'' '||
'AND H.open_flag = ''Y'' ' ||
'AND L.open_flag = ''Y'' ';