The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT count(*)
INTO X_count
FROM po_distributions
WHERE line_location_id = X_line_location_id
AND po_line_id = X_po_line_id
AND po_header_id = X_po_header_id
AND destination_type_code IN ('SHOP FLOOR','INVENTORY')
AND distribution_type <> 'AGREEMENT'; --
initially update to a value other than NULL*/
select plla.promised_date
into X_promised_date
from po_line_locations_archive plla
where plla.line_location_id = X_line_location_id
and plla.revision_num = (select min(revision_num)
from po_line_locations_archive plla2
where plla2.line_location_id = X_line_location_id
and plla2.promised_date is not NULL);
select count(*)
into X_dist_num
from po_distributions
where line_location_id = X_line_location_id;
select code_combination_id
into X_code_combination_id
from po_distributions
where line_location_id = X_line_location_id;
SELECT (pll.quantity - nvl(pll.quantity_cancelled,0)) -
(nvl(sum(pll2.quantity - nvl(pll2.quantity_cancelled,0)),0) -
nvl(X_orig_quantity,0) +
nvl(X_quantity,0)),
(pll.quantity - nvl(pll.quantity_cancelled,0)) -
(nvl(sum(pll2.quantity - nvl(pll2.quantity_cancelled,0) -
nvl(X_orig_quantity,0)),0))
INTO X_unreleased_quantity,
X_available_quantity
FROM po_line_locations pll2,
po_line_locations pll
WHERE pll.line_location_id = pll2.source_shipment_id(+)
AND pll.line_location_id = X_source_shipment_id
AND pll.shipment_type <> 'PRICE BREAK'
GROUP BY (pll.quantity - nvl(pll.quantity_cancelled,0));