The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT *
FROM jmf_subcontract_orders
WHERE subcontract_po_shipment_id = p_subcontract_po_shipment_id;
SELECT poll.line_location_id
FROM po_line_locations_all poll
, po_headers_all poh
, po_lines_all pol
WHERE poll.po_header_id = poh.po_header_id
AND poll.po_line_id = pol.po_line_id
AND pol.line_reference_num = p_subcontract_po_shipment_id || '-' || l_interface_line_id
AND poh.reference_num = p_subcontract_po_shipment_id || '-' || l_interface_header_id
AND poh.agent_id = l_agent_id /*Bug 7383584 : Added extra where clause to stop FTS on po_headers_all table*/
AND poll.line_location_id > l_max_line_location_id;
SELECT NVL(primary_uom_price,0)/NVL(quantity,1)
INTO l_price
FROM jmf_shikyu_components
WHERE subcontract_po_shipment_id = p_subcontract_po_shipment_id
AND shikyu_component_id = l_item_id;
SELECT
org_id
INTO
l_org_id
FROM po_line_locations_all
WHERE line_location_id = l_subcontract_orders_rec.subcontract_po_shipment_id;
SELECT
user_defined_po_num_code
INTO
l_po_num_code
FROM
po_system_parameters_all
WHERE org_id = l_org_id;
SELECT to_number(hoi.org_information3)
, to_number(hoi.org_information4)
, po_headers_interface_s.nextval
, po_lines_interface_s.nextval
INTO l_vendor_id
, l_vendor_site_id
, l_interface_header_id
, l_interface_line_id
FROM HR_ORGANIZATION_INFORMATION hoi
WHERE hoi.organization_id = l_subcontract_orders_rec.oem_organization_id
AND hoi.org_information_context = 'Customer/Supplier Association';
SELECT glb.currency_code
INTO l_currency_code
FROM org_organization_definitions ood
, gl_sets_of_books glb
WHERE ood.set_of_books_id = glb.set_of_books_id
AND ood.organization_id = l_subcontract_orders_rec.oem_organization_id;
SELECT glb.currency_code
INTO l_currency_code
FROM hr_organization_information hoi
, gl_sets_of_books glb
WHERE hoi.organization_id = l_subcontract_orders_rec.oem_organization_id
AND org_information_context = 'Accounting Information'
AND TO_NUMBER(hoi.org_information1) = glb.set_of_books_id;
SELECT employee_id
INTO l_agent_id
FROM fnd_user
WHERE user_id = l_user_id;
SELECT NVL(need_by_date, promised_date)
INTO l_subcontract_orders_rec.need_by_date
FROM po_line_locations_all
WHERE line_location_id = l_subcontract_orders_rec.subcontract_po_shipment_id;
SELECT location_id
INTO l_ship_to_location_id
FROM hr_all_organization_units
WHERE organization_id = l_subcontract_orders_rec.tp_organization_id;
INSERT INTO po_headers_interface
( interface_header_id
, action
, document_type_code
, document_num
, vendor_id
, vendor_site_id
, agent_id
, reference_num
, currency_code
, ship_to_location_id
, batch_id
, process_code
, approval_status
, approved_date
, last_update_date
, last_updated_by
, last_update_login
, creation_date
, created_by
)
VALUES
( l_interface_header_id
, 'ORIGINAL'
, 'STANDARD'
, l_document_number
, l_vendor_id
, l_vendor_site_id
, l_agent_id
, p_subcontract_po_shipment_id || '-' || l_interface_header_id
, l_currency_code
, l_ship_to_location_id
, l_batch_id
, 'PENDING'
, 'APPROVED'
, sysdate
, sysdate
, 1
, 1
, sysdate
, 1
);
, G_PKG_NAME || ': Inserted into po_headers_interface');
INSERT INTO po_lines_interface
( interface_header_id
, interface_line_id
, line_num
, item_id
, quantity
, need_by_date
, promised_date
, unit_price
, days_early_receipt_allowed
, days_late_receipt_allowed
, qty_rcv_tolerance
, allow_substitute_receipts_flag
, receiving_routing_id
, organization_id
, ship_to_organization_id
, line_reference_num
, last_update_date
, last_updated_by
, last_update_login
, creation_date
, created_by
, INVOICE_CLOSE_TOLERANCE
)
VALUES
( l_interface_header_id
, l_interface_line_id
, 1
, l_item_id
, l_quantity
, l_need_by_date
, l_need_by_date
, l_price
, 100
, 100
, 200
, 'N'
, 3
, l_subcontract_orders_rec.tp_organization_id
, l_subcontract_orders_rec.tp_organization_id
--, l_interface_header_id
, p_subcontract_po_shipment_id || '-' || l_interface_line_id
, sysdate
, 1
, 1
, sysdate
, 1
, 100
);
, G_PKG_NAME || ': Inserted into po_lines_interface');
INSERT INTO po_distributions_interface
( interface_header_id
, interface_line_id
, interface_distribution_id
, quantity_ordered
, project_id
, task_id
, last_update_date
, last_updated_by
, last_update_login
, creation_date
, created_by
)
VALUES
( l_interface_header_id
, l_interface_line_id
, PO_DISTRIBUTIONS_INTERFACE_S.nextval
, l_quantity
, l_subcontract_orders_rec.project_id
, l_subcontract_orders_rec.task_id
, sysdate
, 1
, 1
, sysdate
, 1
);
, G_PKG_NAME || ': Inserted into po_distributions_interface');
SELECT max(line_location_id)
INTO l_max_line_location_id
FROM po_line_locations_all;
SELECT segment1
INTO l_order_number
FROM po_headers_all poh
WHERE EXISTS
(SELECT 1 FROM po_line_locations_all poll
WHERE poll.line_location_id = l_subcontract_orders_rec.subcontract_po_shipment_id
AND poll.po_header_id = poh.po_header_id);
SELECT segment1
INTO l_sub_comp
FROM mtl_system_items_b
WHERE inventory_item_id = l_item_id
AND organization_id = l_subcontract_orders_rec.tp_organization_id;