The following lines contain the word 'select', 'insert', 'update' or 'delete':
PROCEDURE purge_req(x_updated_days IN NUMBER default 1) is
cursor c_req (p_date number) is
select distinct prh.requisition_header_id
from po_requisition_headers_all prh, po_requisition_lines_all prl
where prh.authorization_status ='SYSTEM_SAVED'
and prh.requisition_header_id = prl.requisition_header_id (+)
and prh.last_update_date < (sysdate-p_date)
and prl.line_location_id is null
order by prh.requisition_header_id;
select requisition_header_id
from po_requisition_headers_all
where authorization_status ='SYSTEM_SAVED'
and last_update_date < (sysdate-p_date)
order by requisition_header_id;
if(x_updated_days>1) then
age := x_updated_days;
delete po_approval_list_lines
where APPROVAL_LIST_HEADER_ID in
( select approval_list_header_id
from po_approval_list_headers
where document_id = syssaved_req_header_id
and document_type = 'REQUISITION');
delete po_approval_list_headers
where document_id = syssaved_req_header_id
and document_type = 'REQUISITION';
delete PO_REQ_DISTRIBUTIONS_ALL
where REQUISITION_LINE_ID in
( select requisition_line_id
from PO_REQUISITION_LINES_ALL
where REQUISITION_HEADER_ID = syssaved_req_header_id);
delete PO_REQUISITION_LINES_ALL
where REQUISITION_HEADER_ID = syssaved_req_header_id;
delete PO_REQUISITION_HEADERS_ALL
where REQUISITION_HEADER_ID = syssaved_req_header_id;