The following lines contain the word 'select', 'insert', 'update' or 'delete':
select security_level_code
into X_security_level_code
from po_document_types
where document_type_code = X_po_type
and document_subtype = X_po_sub_type;
/* Select the Currency Code the given PO is in */
select currency_code
into X_currency_code
from po_headers_all -- FPI GA
where po_header_id = X_po_header_id;
SELECT currency_code,
rate_type,
rate_date,
rate
INTO x_currency_code,
x_rate_type,
x_rate_date,
x_rate
FROM po_headers_all
WHERE po_header_id = p_po_header_id;
SELECT segment1
INTO x_doc_num
FROM po_headers_all -- FPI GA
WHERE po_header_id = x_header_id;
select max(po_header_id)
into x_po_header_id_record.po_header_id
from po_headers
where segment1 = X_po_header_id_record.document_num;
SELECT plc_sta.displayed_field,
decode(poh.cancel_flag,
'Y', plc_can.displayed_field, NULL),
decode(nvl(poh.closed_code, 'OPEN'), 'OPEN', NULL,
plc_clo.displayed_field),
decode(poh.frozen_flag,
'Y', plc_fro.displayed_field, NULL),
decode(poh.user_hold_flag,
'Y', plc_hld.displayed_field, NULL),
poh.authorization_status,
nvl(poh.cancel_flag, 'N'),
poh.closed_code,
nvl(poh.frozen_flag, 'N'),
nvl(poh.user_hold_flag, 'N'),
poh.type_lookup_code,
poh.org_id -- Bug 3208853
into x_status_code,
x_cancel_status,
x_closed_status,
x_frozen_status,
x_hold_status,
x_auth_status,
x_cancel_flag,
x_closed_code,
x_frozen_flag,
x_user_hold_flag,
x_type_lookup_code,
l_org_id -- Bug 3208853
from po_lookup_codes plc_sta,
po_lookup_codes plc_can,
po_lookup_codes plc_clo,
po_lookup_codes plc_fro,
po_lookup_codes plc_hld,
po_headers_all poh -- Bug 3208853
where plc_sta.lookup_code =
decode(poh.approved_flag,
'R', poh.approved_flag,
nvl(poh.authorization_status,'INCOMPLETE'))
and plc_sta.lookup_type in ('PO APPROVAL', 'DOCUMENT STATE')
and plc_can.lookup_code = 'CANCELLED'
and plc_can.lookup_type = 'DOCUMENT STATE'
and plc_clo.lookup_code = nvl(poh.closed_code, 'OPEN')
and plc_clo.lookup_type = 'DOCUMENT STATE'
and plc_fro.lookup_code = 'FROZEN'
and plc_fro.lookup_type = 'DOCUMENT STATE'
and plc_hld.lookup_code = 'ON HOLD'
and plc_hld.lookup_type = 'DOCUMENT STATE'
and poh.po_header_id = X_po_header_id;
SELECT x_status_code||
decode(x_closed_code, 'OPEN', '', '', '',
x_delimiter||x_closed_status)||
decode(x_cancel_flag, 'N', '', '', '',
x_delimiter||x_cancel_status)||
decode(x_frozen_flag, 'N', '', '', '',
x_delimiter||x_frozen_status)||
decode(x_user_hold_flag, 'N', '', '', '',
x_delimiter||x_hold_status)||
decode(x_reserved_flag, 'N', '', '', '',
x_delimiter||x_reserved_status)
INTO x_status
FROM dual;