The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT POR.po_release_id,
POR.release_num,
POR.revision_num,
--bug 3633863: removed decode on release_id; always use header_id
POLL.sales_order_update_date,
FRT.party_id
INTO x_po_releases_attributes.source_blanket_reference_id,
x_po_releases_attributes.source_blanket_reference_num,
x_po_releases_attributes.release_revision,
x_po_releases_attributes.header_id,
x_po_releases_attributes.vendor_id,
x_po_releases_attributes.ship_from_site_id,
x_po_releases_attributes.hold_code,
x_po_releases_attributes.freight_terms_code,
x_po_releases_attributes.fob_point_code,
x_po_releases_attributes.source_header_number,
x_po_releases_attributes.source_header_type_id,
x_po_releases_attributes.source_header_type_name,
x_po_releases_attributes.org_id,
x_po_releases_attributes.currency_code,
x_po_releases_attributes.shipping_control,
x_po_releases_attributes.po_revision,
x_po_releases_attributes.line_id,
x_po_releases_attributes.inventory_item_id,
x_po_releases_attributes.item_description,
x_po_releases_attributes.hazard_class_id,
x_po_releases_attributes.revision,
x_po_releases_attributes.supplier_item_num,
x_po_releases_attributes.source_line_number,
x_po_releases_attributes.source_line_type_code,
x_po_releases_attributes.country_of_origin,
x_po_releases_attributes.ship_to_location_id,
x_po_releases_attributes.ship_tolerance_above,
x_po_releases_attributes.ship_tolerance_below,
x_po_releases_attributes.shipped_quantity,
x_po_releases_attributes.request_date,
x_po_releases_attributes.schedule_ship_date,
x_po_releases_attributes.organization_id,
x_po_releases_attributes.ordered_quantity,
x_po_releases_attributes.order_quantity_uom,
x_po_releases_attributes.cancelled_quantity,
x_po_releases_attributes.unit_list_price,
x_po_releases_attributes.preferred_grade,
x_po_releases_attributes.ordered_quantity2,
x_po_releases_attributes.ordered_quantity_uom2,
x_po_releases_attributes.cancelled_quantity2,
x_po_releases_attributes.po_shipment_line_number,
x_po_releases_attributes.days_early_receipt_allowed,
x_po_releases_attributes.days_late_receipt_allowed,
x_po_releases_attributes.drop_ship_flag,
x_po_releases_attributes.qty_rcv_exception_code,
x_po_releases_attributes.closed_flag,
x_po_releases_attributes.closed_code,
x_po_releases_attributes.cancelled_flag,
x_po_releases_attributes.receipt_days_exception_code,
x_po_releases_attributes.enforce_ship_to_location_code,
x_po_releases_attributes.shipping_details_updated_on,
x_po_releases_attributes.carrier_id
FROM PO_HEADERS_ALL POH,
PO_LINES_ALL POL,
PO_LINE_LOCATIONS_ALL POLL,
PO_RELEASES_ALL POR,
PO_LINE_TYPES_B PLT,
MTL_UNITS_OF_MEASURE MUOM,
MTL_UNITS_OF_MEASURE MUOM1,
ORG_FREIGHT_TL FRT,
PO_DOCUMENT_TYPES_ALL_TL PDT -- Bug #4635593
WHERE POLL.line_location_id = p_line_location_id
AND PDT.document_type_code =
DECODE(POLL.po_release_id, NULL, 'PO', 'PA')
AND PDT.document_subtype
= DECODE(POLL.po_release_id, NULL, POH.type_lookup_code,
POR.release_type)
AND POL.po_line_id = POLL.po_line_id
AND POH.po_header_id = POL.po_header_id
AND POR.po_release_id(+) = POLL.po_release_id
AND FRT.freight_code (+) = POH.ship_via_lookup_code
AND FRT.language (+) = USERENV('LANG')
AND NVL(FRT.organization_id, POLL.ship_to_organization_id)
= POLL.ship_to_organization_id
AND POL.line_type_id = PLT.line_type_id
AND MUOM.unit_of_measure = POL.unit_meas_lookup_code
AND MUOM1.unit_of_measure(+) = POLL.secondary_unit_of_measure
AND POH.ORG_ID = PDT.ORG_ID -- Bug #4635593
AND PDT.LANGUAGE = USERENV('LANG'); -- Bug #4635593