The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT displayed_field
INTO l_sort
FROM po_lookup_codes
WHERE lookup_code = P_ORDERBY
AND lookup_type = 'SRS ORDER BY';
select structure_id
into l_p_struct_num
from mtl_default_sets_view
where functional_area_id = 2 ;
SELECT SUM( (nvl(PLL.quantity,0) -
nvl(PLL.quantity_cancelled,0) ) *
nvl(PLL.price_override,0))
INTO X_TOTAL
FROM PO_LINE_LOCATIONS PLL
WHERE PLL.po_header_id = po_header_id1
AND PLL.shipment_type = 'PLANNED';
SELECT sum((pll.quantity -
nvl(pll.quantity_cancelled,0))*
nvl(pll.price_override,0))
INTO X_TOTAL
FROM PO_LINE_LOCATIONS PLL
WHERE PLL.po_header_id = PO_HEADER_ID1
AND PLL.shipment_type = 'SCHEDULED';
SELECT nvl(global_agreement_flag,'N')
INTO X_GA_FLAG
FROM po_headers_all
WHERE po_header_id = po_header_id1;
SELECT SUM (DECODE (POL.order_type_lookup_code,
'RATE', PLL.amount - NVL(PLL.amount_cancelled, 0),
'FIXED PRICE', PLL.amount - NVL(PLL.amount_cancelled, 0),
(NVL(PLL.quantity, 0) - NVL(PLL.quantity_cancelled, 0))
* NVL(PLL.price_override, 0)))
INTO X_RELEASED_AMT
FROM po_line_locations pll,
po_headers poh,
po_lines POL
WHERE poh.po_header_id = POL.po_header_id
AND POL.po_line_id = PLL.po_line_id
AND pll.shipment_type not in ('PRICE BREAK')
AND poh.po_header_id = po_header_id1;
SELECT SUM (DECODE (POL.order_type_lookup_code,
'RATE', PLL.amount - NVL(PLL.amount_cancelled, 0),
'FIXED PRICE', PLL.amount - NVL(PLL.amount_cancelled, 0),
(NVL(PLL.quantity, 0) - NVL(PLL.quantity_cancelled, 0))
* NVL(PLL.price_override, 0)))
INTO X_RELEASED_AMT
FROM po_line_locations_all pll,
po_headers_all poh,
po_lines_all POL
WHERE poh.po_header_id = pll.from_header_id
AND POH.po_header_id = POL.po_header_id
AND POL.po_line_id = PLL.from_line_id
AND pll.shipment_type not in ('PRICE BREAK')
AND poh.po_header_id = po_header_id1;
select global_agreement_flag into l_ga_flag
from po_headers
where po_header_id=po_header_id1;
SELECT (min(poh.blanket_total_amount)- sum( round(
(decode (pol.quantity, null, (pod.amount_ordered - pod.amount_cancelled),
(( pod.quantity_ordered - pod.quantity_cancelled ) * poll.price_override)))
))) REMAIN into x_remain_amt
FROM po_distributions_all pod, po_line_locations_all poll, po_lines_all pol,po_headers poh
WHERE pod.line_location_id = poll.line_location_id AND
poll.po_line_id = pol.po_line_id AND
pol.from_header_id =po_header_id1
and poh.po_header_id=po_header_id1;
SELECT (MIN(POH.blanket_total_amount) -
SUM( DECODE (POL.order_type_lookup_code,
'RATE', PLL.amount - NVL(PLL.amount_cancelled, 0),
'FIXED PRICE', PLL.amount - NVL(PLL.amount_cancelled, 0),
(nvl(pll.quantity,0) - nvl(pll.quantity_cancelled,0))
* nvl(price_override,0)))) REMAIN
INTO X_REMAIN_AMT
FROM po_line_locations pll
, po_headers poh
, po_lines POL
WHERE poh.po_header_id = POL.po_header_id(+)
AND POL.po_line_id = PLL.po_line_id (+)
AND pll.shipment_type not in ('PRICE BREAK')
AND poh.po_header_id = po_header_id1;
SELECT name
INTO X_ORG_NAME
FROM hr_organization_units
WHERE organization_id = po_org_id;