The following lines contain the word 'select', 'insert', 'update' or 'delete':
Select Line_number,
shipment_number,
option_number,
Component_number,
Service_number
into line_number,
shipment_number,
option_number,
component_number,
service_number
from oe_order_lines_all
where ato_line_id = p_ato_line_id
and item_type_code = 'CONFIG';
select line_id,
flow_status_code
into l_line_id,
l_flow_status_code
from oe_order_lines_all oel
where oel.ato_line_id = p_ato_line_id
and oel.item_type_code = 'CONFIG';
select line_id
into l_demand_line_id
from oe_order_lines_all
where ato_line_id = p_ato_line_id
and item_type_code = 'CONFIG';
select count(*)
into v_ds_po_quantity
from oe_drop_ship_sources ods
where ods.line_id = l_demand_line_id
--and ods.drop_ship_source_id = 2
and ods.po_header_id is not null;
select count(*)
into v_ds_req_quantity
from oe_drop_ship_sources ods
where ods.line_id = l_demand_line_id
--and ods.drop_ship_source_id = 2
and ods.po_header_id is null;
select meaning
into x_result
from mfg_lookups
where lookup_type = 'CTO_WB_SUPPLY_TYPE'
and lookup_code = l_result;
select meaning
into x_result
from mfg_lookups
where lookup_type = 'CTO_WB_SUPPLY_TYPE'
and lookup_code = l_result;
select nvl(sum(reservation_quantity),0)
into v_wip_quantity
from mtl_reservations
where demand_source_type_id = decode (l_source_document_type_id, 10,
inv_reservation_global.g_source_type_internal_ord,
inv_reservation_global.g_source_type_oe )
and demand_source_line_id = l_demand_line_id
and supply_source_type_id = inv_reservation_global.g_source_type_wip;
select count(*)
into v_flow_count
from wip_flow_schedules
where demand_source_type = inv_reservation_global.g_source_type_oe
and demand_source_line =to_char(l_demand_line_id)
and status = 1;
select meaning
into x_result
from mfg_lookups
where lookup_type = 'CTO_WB_SUPPLY_TYPE'
and lookup_code = l_result;
select nvl(sum(reservation_quantity),0)
into v_po_quantity
from mtl_reservations
where demand_source_type_id = decode (l_source_document_type_id,
10, inv_reservation_global.g_source_type_internal_ord,
inv_reservation_global.g_source_type_oe )
and demand_source_line_id = l_demand_line_id
and supply_source_type_id = inv_reservation_global.g_source_type_po;
select meaning
into x_result
from mfg_lookups
where lookup_type = 'CTO_WB_SUPPLY_TYPE'
and lookup_code = l_result;
select nvl(sum(reservation_quantity), 0)
into v_req_quantity
from mtl_reservations
where demand_source_type_id = decode (l_source_document_type_id,
10, inv_reservation_global.g_source_type_internal_ord,
inv_reservation_global.g_source_type_oe )
and demand_source_line_id = l_demand_line_id
and supply_source_type_id = inv_reservation_global.g_source_type_req;
select meaning
into x_result
from mfg_lookups
where lookup_type = 'CTO_WB_SUPPLY_TYPE'
and lookup_code = l_result;
select nvl(sum(reservation_quantity), 0)
into v_ireq_quantity
from mtl_reservations
where demand_source_type_id = decode (l_source_document_type_id,
10, inv_reservation_global.g_source_type_internal_ord,
inv_reservation_global.g_source_type_oe )
and demand_source_line_id = l_demand_line_id
and supply_source_type_id = inv_reservation_global.g_source_type_internal_req;
select meaning
into x_result
from mfg_lookups
where lookup_type = 'CTO_WB_SUPPLY_TYPE'
and lookup_code = l_result;
select nvl(sum(reservation_quantity), 0)
into v_asn_quantity
from mtl_reservations
where demand_source_type_id = decode (l_source_document_type_id,
10, inv_reservation_global.g_source_type_internal_ord,
inv_reservation_global.g_source_type_oe )
and demand_source_line_id = l_demand_line_id
and supply_source_type_id = inv_reservation_global.g_source_type_asn;
select meaning
into x_result
from mfg_lookups
where lookup_type = 'CTO_WB_SUPPLY_TYPE'
and lookup_code = l_result;
select meaning
into x_result
from mfg_lookups
where lookup_type = 'CTO_WB_SUPPLY_TYPE'
and lookup_code = l_result;
select line_id into l_config_line_id
from oe_order_lines_all
where ato_line_id = p_ato_line_id
and item_type_code = 'CONFIG';
select concatenated_segments
into l_item_name
from mtl_system_items_kfv
where inventory_item_id = p_config_item
and rownum =1;
select concatenated_segments
into l_item_name
from mtl_system_items_kfv mtl,
oe_order_lines_all oel
where oel.ato_line_id = p_ato_line_id
and oel.item_type_code = 'CONFIG'
and oel.inventory_item_id = mtl.inventory_item_id
and mtl.organization_id = p_ship_org_id;
select description
into l_item_desc
from mtl_system_items_kfv
where inventory_item_id = p_config_item
and rownum = 1;
select description
into l_item_desc
from mtl_system_items_kfv mtl,
oe_order_lines_all oel
where mtl.inventory_item_id = oel.inventory_item_id
and mtl.organization_id = p_ship_org_id
and oel.ato_line_id = p_ato_line_id
and oel.item_type_code = 'CONFIG';
select h.source_document_type_id
into l_source_document_type_id
from oe_order_headers_all h, oe_order_lines_all l
where h.header_id = l.header_id
and l.line_id = pLineId
and rownum = 1;
select full_name
into l_buyer_name
from per_people_f
where person_id = P_suggested_buyer_id;
select line_id
into l_line_id
from oe_order_lines_all
where ato_line_id = p_ato_line_id
and item_type_code = 'CONFIG';
select sum(primary_reservation_quantity),primary_uom_code
into l_prim_rsv_qty, l_prim_uom_code
from mtl_reservations
where demand_source_line_id = l_line_id
and supply_source_TYpe_id = 13
group by primary_uom_code;
select CTO_WORKBENCH_UTIL_PK.convert_uom(l_prim_uom_code,
oel.order_quantity_uom,
nvl(l_prim_rsv_qty,0),
oel.inventory_item_id)
into l_rsv_qty
from oe_order_lines_all oel
where oel.line_id = l_line_id;
Select max(exp_comp_date) into l_date
from
(SELECT wdj.scheduled_completion_date exp_comp_date
FROM mtl_reservations mr, wip_discrete_jobs wdj
WHERE mr.demand_source_type_id = decode(CTO_WORKBENCH_UTIL_PK.get_source_document_id(l_config_line_id), 10,8,2)
AND mr.demand_source_line_id = l_config_line_id
AND mr.supply_source_type_id = 5
AND wdj.wip_entity_id = mr.supply_source_header_id
AND wdj.organization_id = mr.organization_id
UNION
SELECT wfs.scheduled_completion_date exp_comp_date
FROM wip_flow_schedules wfs
WHERE wfs.demand_source_line = to_char(l_config_line_id)
AND wfs.status = 1
UNION
select nvl(poll.promised_date,poll.need_by_date) exp_comp_date
from mtl_reservations mr, po_line_locations_all poll
where mr.demand_source_type_id = 2
and mr.demand_source_line_id = l_config_line_id
and mr.supply_source_type_id = 1
and mr.supply_source_header_id = poll.po_header_id
and mr.supply_source_line_id = poll.line_location_id
UNION
select porl.need_by_date exp_comp_date
from mtl_reservations mr, po_requisition_lines_all porl
where mr.demand_source_type_id = 2
and mr.demand_source_line_id = l_config_line_id
and mr.supply_source_type_id in (7, 17)
and mr.supply_source_header_id = porl.requisition_header_id
and mr.supply_source_line_id = porl.requisition_line_id
UNION
select nvl(poll.promised_date,poll.need_by_date) exp_comp_date
from oe_drop_ship_sources ods, po_line_locations_all poll
where ods.line_id = l_config_line_id
and ods.po_header_id = poll.po_header_id
and ods.line_location_id = poll.line_location_id
UNION
select porl.need_by_date exp_comp_date
from oe_drop_ship_sources ods, po_requisition_lines_all porl
where ods.line_id = l_config_line_id
and ods.po_header_id is null
and ods.requisition_header_id = porl.requisition_header_id
and ods.requisition_line_id = porl.requisition_line_id
UNION
select asn_headers.expected_receipt_date exp_comp_date
from mtl_reservations mr,
rcv_shipment_lines ASN_LINES,
rcv_shipment_headers asn_headers
where mr.demand_source_type_id = 2
and mr.demand_source_line_id = l_config_line_id
and mr.supply_source_type_id = 25
and mr.supply_source_line_detail = ASN_LINES.shipment_line_id
and asn_headers.shipment_header_id = asn_lines.shipment_header_id
and ASN_LINES.asn_line_flag = 'Y');
select line_id
into l_line_id
from oe_order_lines_all
where ato_line_id = p_ato_line_id
and item_type_code = 'CONFIG';
select sum(primary_reservation_quantity),primary_uom_code
into l_prim_rsv_qty, l_prim_uom_code
from mtl_reservations
where demand_source_line_id = l_line_id
and supply_source_TYpe_id = 27
group by primary_uom_code;
select CTO_WORKBENCH_UTIL_PK.convert_uom(l_prim_uom_code,
oel.order_quantity_uom,
nvl(l_prim_rsv_qty,0),
oel.inventory_item_id)
into l_rsv_qty
from oe_order_lines_all oel
where oel.line_id = l_line_id;
select line_id into x_config_line_id
from oe_order_lines_all
where ato_line_id = p_ato_line_id
and item_type_code = 'CONFIG';