The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT DECODE(min(nvl(t.intorder_posted_ind,-1)),-1,DECODE(c_entry_type,'M','X','O'),'N'),
DECODE(NVL(min(t.invoiced_flag),'-1'),'-1',0,'P',2,1)
FROM po_requisition_headers_all prh,
po_requisition_lines_all prl,
oe_order_lines_all oel,
ic_tran_pnd t
WHERE prl.requisition_header_id = prh.requisition_header_id
and prh.segment1 = oel.orig_sys_document_ref
and prl.requisition_line_id = oel.source_document_line_id
and oel.order_source_id = 10
and oel.line_id = t.line_id
and t.doc_type = 'OMSO'
and t.completed_ind = 1
and t.delete_mark = 0
and prl.requisition_line_id = c_req_line_id;
SELECT max(t.trans_id)
FROM po_requisition_headers_all prh,
po_requisition_lines_all prl,
oe_order_lines_all oel,
ic_tran_pnd t
WHERE prl.requisition_header_id = prh.requisition_header_id
and prh.segment1 = oel.orig_sys_document_ref
and prl.requisition_line_id = oel.source_document_line_id
and oel.order_source_id = 10
and oel.line_id = t.line_id
and t.doc_type = 'OMSO'
and t.completed_ind = 1
and t.delete_mark = 0
and oel.inventory_item_id = cp_inv_item_id
and prl.requisition_line_id = (SELECT t.requisition_line_id
FROM rcv_transactions t
,ic_tran_pnd pnd
WHERE t.shipment_header_id = pnd.doc_id
and t.transaction_id = pnd.line_id
and pnd.doc_type = 'PORC'
and pnd.completed_ind = 1
and pnd.delete_mark = 0
and pnd.trans_id = cp_trans_id
);