The following lines contain the word 'select', 'insert', 'update' or 'delete':
CURSOR findEncCursor(requisition_id VARCHAR2) IS select ENCUMBERED_FLAG,LAST_UPDATED_BY from PO_REQUISITION_LINES_ALL where REQUISITION_HEADER_ID = requisition_id;
select segment1, authorization_status
into l_req_number, l_authorization_status
from PO_REQUISITION_HEADERS_ALL
where REQUISITION_HEADER_ID = p_existing_requisition_id;
delete PO_REQ_DISTRIBUTIONS_ALL
where REQUISITION_LINE_ID in
( select requisition_line_id
from PO_REQUISITION_LINES_ALL
where REQUISITION_HEADER_ID = p_existing_requisition_id);
delete PO_REQUISITION_LINES_ALL
where REQUISITION_HEADER_ID = p_existing_requisition_id;
delete PO_REQUISITION_HEADERS_ALL
where REQUISITION_HEADER_ID = p_existing_requisition_id;
delete po_approval_list_lines
where APPROVAL_LIST_HEADER_ID in
( select approval_list_header_id
from po_approval_list_headers
where document_id = p_existing_requisition_id
and document_type = 'REQUISITION');
delete po_approval_list_headers
where document_id = p_existing_requisition_id
and document_type = 'REQUISITION';
update PO_REQUISITION_LINES_ALL
set REQUISITION_HEADER_ID = p_existing_requisition_id
where REQUISITION_HEADER_ID = p_new_requisition_id;
update PO_REQUISITION_HEADERS_ALL
set REQUISITION_HEADER_ID = p_existing_requisition_id,
SEGMENT1 = l_req_number,
AUTHORIZATION_STATUS = 'INCOMPLETE'
where REQUISITION_HEADER_ID = p_new_requisition_id;
update po_approval_list_headers
set document_id = p_existing_requisition_id
where document_id = p_new_requisition_id;
select nvl(fsp.req_encumbrance_flag, 'N'), set_of_books_id
into l_req_encumber, l_sob_id
from FINANCIALS_SYSTEM_PARAMETERS fsp;
update po_req_distributions
set GL_ENCUMBERED_DATE = sysdate,
GL_ENCUMBERED_PERIOD_NAME = l_gl_period
where nvl(encumbered_flag,'N') = 'N' and
REQUISITION_LINE_ID in
( select requisition_line_id
from PO_REQUISITION_LINES_ALL
where REQUISITION_HEADER_ID = p_existing_requisition_id);
po_forward_sv1.update_action_history (p_existing_requisition_id,
l_req_doc_type,
NULL,
l_req_action_history_code,
l_req_control_reason,
fnd_global.user_id,
fnd_global.login_id);
po_forward_sv1.insert_action_history (p_existing_requisition_id,
l_req_doc_type,
l_doc_subtype,
NULL,
l_req_action_history_code,
sysdate,
p_agentId,
NULL,
l_req_control_reason,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
fnd_global.user_id,
fnd_global.login_id);
SELECT wf_item_type, wf_item_key
INTO l_item_type, l_item_key
FROM po_requisition_headers
WHERE requisition_header_id= p_headerId;
SELECT root_activity
INTO l_root_activity
FROM wf_items
WHERE item_type = l_item_type AND item_key = l_item_key;
SELECT NVL(activity_status_code, 'N')
INTO l_activity_status
FROM wf_item_activity_statuses_v
WHERE item_type = l_item_type AND item_key = l_item_key
AND ACTIVITY_NAME=l_root_activity;