The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT wrh.response_header_id,
wrh.vendor_id,
wrh.error_type,
wrh.error_code,
wrr.interpreted_value_code,
wrh.EXPORT_COMPLIANCE_STATUS,
wrh.SERVICE_TYPE_CODE
FROM WSH_ITM_REQUEST_CONTROL WRC,
WSH_ITM_RESPONSE_HEADERS WRH,
WSH_ITM_RESPONSE_RULES WRR
WHERE wrc.request_control_id = req_control_id
AND wrc.response_header_id = wrh.response_header_id
AND nvl(wrh.error_code,-99) = nvl(wrr.error_code,nvl(wrh.error_code,-99))
AND wrh.error_type = wrr.error_type(+)
AND wrh.vendor_id = wrr.vendor_id(+);
SELECT response_line_id,
error_code error_code,
error_type error_type,
denied_party_flag,
embargo_flag,
service_type_code
FROM WSH_ITM_RESPONSE_LINES
WHERE response_header_id = resp_header_id
ORDER BY service_type_code;
SELECT interpreted_value_code
FROM WSH_ITM_RESPONSE_RULES
WHERE error_type = p_error_type
AND nvl(error_code,-99) = nvl(p_error_code,nvl(error_code,-99))
AND vendor_id = p_vendor_id
ORDER BY error_code;
UPDATE wsh_itm_request_control
SET process_flag = 1
WHERE request_control_id = p_request_control_id;
SELECT
DISTINCT wrc.request_control_id
FROM
WSH_ITM_REQUEST_CONTROL wrc,
WSH_ITM_RESPONSE_HEADERS wrh,
WSH_ITM_PARTIES wp
WHERE
wrc.response_header_id = wrh.response_header_id
AND wrc.request_control_id = wp.request_control_id
AND wrc.original_system_reference = nvl(p_reference_id, wrc.original_system_reference)
AND wrc.original_system_line_reference = nvl ( p_reference_line_id, wrc.original_system_line_reference)
AND wrc.process_flag IN (1,2)
UNION
SELECT
DISTINCT wrc.request_control_id
FROM
WSH_ITM_REQUEST_CONTROL wrc,
WSH_ITM_RESPONSE_HEADERS wrh,
WSH_ITM_RESPONSE_LINES wrl,
WSH_ITM_PARTIES wp
WHERE
wrc.response_header_id = wrh.response_header_id
AND wrh.response_header_id = wrl.response_header_id
AND wrc.request_control_id = wp.request_control_id
AND wrc.original_system_reference = nvl(p_reference_id, wrc.original_system_reference)
AND wrc.original_system_line_reference = nvl ( p_reference_line_id, wrc.original_system_line_reference)
AND wrc.process_flag IN (1,2);