The following lines contain the word 'select', 'insert', 'update' or 'delete':
X_selected_batch_id IN NUMBER,
p_org_id IN NUMBER DEFAULT NULL, --
p_po_header_id IN NUMBER DEFAULT NULL --
)
IS
d_api_name CONSTANT VARCHAR2(30) := 'process_po_interface_tables';
SELECT interface_header_id,
process_code
BULK COLLECT
INTO l_intf_header_id_tbl,
l_process_code_tbl
FROM po_headers_interface
WHERE (batch_id = X_selected_batch_id
OR X_selected_batch_id IS NULL )
AND ((process_code = PO_PDOI_CONSTANTS.g_process_code_ACCEPTED and X_accepted_flag = 'Y')
OR (process_code = PO_PDOI_CONSTANTS.g_process_code_REJECTED and X_rejected_flag = 'Y')
OR (process_code = PO_PDOI_CONSTANTS.g_process_code_IN_PROCESS AND p_po_header_id IS NOT NULL))
AND (org_id = l_org_id
OR l_org_id is NULL)
AND (document_type_code = UPPER(X_document_type)
OR X_document_type is NULL)
AND (document_subtype = UPPER(X_document_subtype)
OR X_document_subtype is NULL)
AND (Trunc(creation_date) >= X_start_date
OR X_start_date is NULL)
AND (trunc(creation_date) <= X_end_date
OR X_end_date is NULL)
AND (p_po_header_id IS NULL
OR p_po_header_id = po_header_id);
DELETE FROM po_headers_interface
WHERE interface_header_id = l_intf_header_id_tbl(i);
PO_LOG.stmt(d_module, d_position, '# hdr intf rec deleted' || SQL%ROWCOUNT);
DELETE FROM po_lines_interface
WHERE interface_header_id = l_intf_header_id_tbl(i);
PO_LOG.stmt(d_module, d_position, '# line intf rec deleted' || SQL%ROWCOUNT);
DELETE FROM po_line_locations_interface
WHERE interface_header_id = l_intf_header_id_tbl(i);
PO_LOG.stmt(d_module, d_position, '# line loc intf rec deleted' || SQL%ROWCOUNT);
DELETE FROM po_distributions_interface
WHERE interface_header_id = l_intf_header_id_tbl(i);
PO_LOG.stmt(d_module, d_position, '# distr intf rec deleted' || SQL%ROWCOUNT);
DELETE FROM po_price_diff_interface
WHERE interface_header_id = l_intf_header_id_tbl(i);
PO_LOG.stmt(d_module, d_position, '# price diff intf rec deleted' || SQL%ROWCOUNT);
DELETE FROM po_attr_values_interface
WHERE interface_header_id = l_intf_header_id_tbl(i);
PO_LOG.stmt(d_module, d_position, '# attr values intf rec deleted' || SQL%ROWCOUNT);
DELETE FROM po_attr_values_tlp_interface
WHERE interface_header_id = l_intf_header_id_tbl(i);
PO_LOG.stmt(d_module, d_position, '# attr values tlp intf rec deleted' || SQL%ROWCOUNT);
x_intf_header_id_tbl.DELETE(i);