The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT header_id INTO l_header_id
FROM oe_order_lines_all WHERE line_id = p_entity_id;
SELECT header_id INTO l_header_id
FROM oe_price_adjustments WHERE price_adjustment_id = p_entity_id;
SELECT header_id INTO l_header_id
FROM oe_sales_credits WHERE sales_credit_id = p_entity_id;
SELECT header_id INTO l_header_id
FROM oe_blanket_lines_all WHERE line_id = p_entity_id;
SELECT OE_REASONS_S.NEXTVAL INTO x_reason_id FROM dual;
INSERT INTO OE_REASONS
(reason_id,
entity_code,
entity_id,
header_id,
version_number,
reason_type,
reason_code,
comments,
creation_date,
created_by,
last_updated_by,
last_update_date)
VALUES
(x_reason_id,
p_entity_code,
p_entity_id,
l_header_id,
l_version_number,
p_reason_type,
p_reason_code,
p_reason_comments,
sysdate,
nvl(FND_GLOBAL.USER_ID,-1),
nvl(FND_GLOBAL.USER_ID,-1),
sysdate);
SELECT reason_type, reason_code, comments
INTO x_reason_type, x_reason_code, x_reason_comments
FROM OE_REASONS
WHERE REASON_ID = p_reason_id;
SELECT reason_type, reason_code, comments
INTO x_reason_type, x_reason_code, x_reason_comments
FROM OE_REASONS
WHERE entity_code = p_entity_code
AND entity_id = p_entity_id
AND version_number = p_version_number;