The following lines contain the word 'select', 'insert', 'update' or 'delete':
DELETE FROM PO_SESSION_GT
WHERE key = p_key;
INSERT INTO PO_SESSION_GT
( key
, index_num1
, index_num2
)
VALUES
(
p_key
, p_index_num1_vals(i)
, p_index_num2_vals(i)
);
DESCRIPTION: Inserts the values into PO_SESSION_GT at
a new key, returning the key.
PARAMETERS: p_index_num1_vals - the values to be inserted into
the GT Table's index_num1 column.
p_index_num2_vals - the values to be inserted into
the GT Table's index_num2 column.
====================================================================*/
FUNCTION initialize_gt_table (
p_index_num1_vals IN PO_TBL_NUMBER
, p_index_num2_vals IN PO_TBL_NUMBER)
RETURN NUMBER
IS
d_mod CONSTANT VARCHAR2(100) := D_initialize_gt_table;
SELECT approved_flag,authorization_status,cancel_flag,closed_code,frozen_flag,user_hold_flag
INTO l_approved_flag,l_authorization_status,l_cancel_flag,l_closed_code,l_frozen_flag,l_user_hold_flag
FROM po_headers_all
WHERE po_header_id = p_header_id;
SELECT displayed_field
INTO disp_field_sta
FROM po_lookup_codes
WHERE lookup_code = DECODE(l_approved_flag,
'R', l_approved_flag,
NVL(l_authorization_status, 'INCOMPLETE'))
AND lookup_type IN ( 'PO APPROVAL', 'DOCUMENT STATE' );
SELECT displayed_field
INTO l_temp
FROM po_lookup_codes
WHERE lookup_code = 'CANCELLED'
AND lookup_type = 'DOCUMENT STATE';
SELECT displayed_field
INTO l_temp
FROM po_lookup_codes
WHERE lookup_code = NVL(l_closed_code, 'OPEN')
AND lookup_type = 'DOCUMENT STATE';
SELECT displayed_field
INTO l_temp
FROM po_lookup_codes
WHERE lookup_type = 'DOCUMENT STATE'
AND lookup_code = 'FROZEN';
SELECT displayed_field
INTO l_temp
FROM po_lookup_codes
WHERE lookup_type = 'DOCUMENT STATE'
AND lookup_code = 'ON HOLD';
select SUM (( quantity_ordered - quantity_cancelled ) /
decode(quantity_ordered,0,1,quantity_ordered ) *
nonrecoverable_tax)
into l_prorated_tax
from po_distributions_all
where po_header_id = x_header_id;
select SUM (( quantity_ordered - quantity_cancelled ) /
decode(quantity_ordered,0,1,quantity_ordered ) *
nonrecoverable_tax)
into l_prorated_tax
from po_distributions_all
where po_header_id = x_header_id
and po_line_id = x_line_id;
select SUM (( quantity_ordered - quantity_cancelled ) /
decode(quantity_ordered,0,1,quantity_ordered ) *
nonrecoverable_tax)
into l_prorated_tax
from po_distributions_all
where po_header_id = x_header_id
and line_location_id = x_line_location_id;
select sum(amount_billed)
into l_amount_billed
from po_distributions_all
where po_header_id = x_header_id;
select sum(amount_billed)
into l_amount_billed
from po_distributions_all
where po_header_id = x_header_id
and po_line_id = x_line_id;