DBA Data[Home] [Help]

APPS.POR_PURGE_SYS_SAVED_REQ SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 4

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;
Line: 16

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;
Line: 32

  if(x_updated_days>1) then
    age := x_updated_days;
Line: 54

    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');
Line: 61

    delete po_approval_list_headers
     where document_id = syssaved_req_header_id
     and document_type = 'REQUISITION';
Line: 65

    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);
Line: 71

    delete PO_REQUISITION_LINES_ALL
     where REQUISITION_HEADER_ID = syssaved_req_header_id;
Line: 74

    delete PO_REQUISITION_HEADERS_ALL
      where REQUISITION_HEADER_ID = syssaved_req_header_id;