The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT
TRANSACTION_SOURCE_TYPE_NAME
INTO SOURCE_TYPE_NAME
FROM
MTL_TXN_SOURCE_TYPES
WHERE TRANSACTION_SOURCE_TYPE_ID = SOURCE_TYPE_ID;
,'Failed in MSTK/Select')*/NULL;
,'Failed in GL#/Select')*/NULL;
SELECT
CATEGORY_SET_NAME
INTO CAT_SET_NAME
FROM
MTL_CATEGORY_SETS
WHERE CATEGORY_SET_ID = CAT_SET_ID;
SELECT
TRANSACTION_TYPE_NAME
INTO TXN_TYPE_NAME
FROM
MTL_TRANSACTION_TYPES
WHERE TRANSACTION_TYPE_ID = TXN_TYPE_ID;
SELECT
REASON_NAME
INTO REASON_NAME
FROM
MTL_TRANSACTION_REASONS
WHERE REASON_ID = TXN_REASON_ID;
RETURN ('cst_cost_updates cst,');
RETURN ('and mta.transaction_source_id = CST.cost_update_id
and CST.description between ''' || P_SOURCE_LO || ''' and ''' || P_SOURCE_HI || ''' ');
RETURN ('and mta.transaction_source_id = CST.cost_update_id
and CST.description between >= ''' || P_SOURCE_LO || ''' ');
RETURN ('and mta.transaction_source_id = CST.cost_update_id
and CST.description <= ''' || P_SOURCE_HI || ''' ');
if Type_id = 1 then select segment1 into txn_source
from po_headers_all
where po_header_id = to_number(txn_source_id);
select request_number into txn_source
from mtl_txn_request_headers
where header_id = to_number(txn_source_id);
select wip_entity_name into txn_source
from wip_entities
where wip_entity_id = to_number(txn_source_id);
elsif Type_id = 7 then select segment1 into txn_source
from po_requisition_headers_all
where requisition_header_id =
txn_source_id;
select CYCLE_COUNT_HEADER_NAME into txn_source
from mtl_cycle_count_headers
where cycle_count_header_id = to_number(txn_source_id)
and organization_id = org_id;
select physical_inventory_name into txn_source
from mtl_physical_inventories
where physical_inventory_id = to_number(txn_source_id)
and organization_id = org_id;
select description into txn_source
from cst_cost_updates
where cost_update_id = to_number(txn_source_id);
if Type_id1 = 1 then select segment1 into txn_source
from po_headers_all
where po_header_id = to_number(txn_source_id);
select request_number into txn_source
from mtl_txn_request_headers
where header_id = to_number(txn_source_id);
select wip_entity_name into txn_source
from wip_entities
where wip_entity_id = to_number(txn_source_id);
elsif Type_id1 = 7 then select segment1 into txn_source
from po_requisition_headers_all
where requisition_header_id =
txn_source_id;
select CYCLE_COUNT_HEADER_NAME into txn_source
from mtl_cycle_count_headers
where cycle_count_header_id = to_number(txn_source_id)
and organization_id = org_id;
select physical_inventory_name into txn_source
from mtl_physical_inventories
where physical_inventory_id = to_number(txn_source_id)
and organization_id = org_id;
select description into txn_source
from cst_cost_updates
where cost_update_id = to_number(txn_source_id);
if Type_id2 = 1 then select segment1 into txn_source
from po_headers_all
where po_header_id = to_number(txn_source_id);
select request_number into txn_source
from mtl_txn_request_headers
where header_id = to_number(txn_source_id);
select wip_entity_name into txn_source
from wip_entities
where wip_entity_id = to_number(txn_source_id);
elsif Type_id2 = 7 then select segment1 into txn_source
from po_requisition_headers_all
where requisition_header_id =
txn_source_id;
select CYCLE_COUNT_HEADER_NAME into txn_source
from mtl_cycle_count_headers
where cycle_count_header_id = to_number(txn_source_id)
and organization_id = org_id;
select physical_inventory_name into txn_source
from mtl_physical_inventories
where physical_inventory_id = to_number(txn_source_id)
and organization_id = org_id;
select description into txn_source
from cst_cost_updates
where cost_update_id = to_number(txn_source_id);
if Type_id3 = 1 then select segment1 into txn_source
from po_headers_all
where po_header_id = to_number(txn_source_id);
select request_number into txn_source
from mtl_txn_request_headers
where header_id = to_number(txn_source_id);
select wip_entity_name into txn_source
from wip_entities
where wip_entity_id = to_number(txn_source_id);
elsif Type_id3 = 7 then select segment1 into txn_source
from po_requisition_headers_all
where requisition_header_id =
txn_source_id;
select CYCLE_COUNT_HEADER_NAME into txn_source
from mtl_cycle_count_headers
where cycle_count_header_id = to_number(txn_source_id)
and organization_id = org_id;
select physical_inventory_name into txn_source
from mtl_physical_inventories
where physical_inventory_id = to_number(txn_source_id)
and organization_id = org_id;
select description into txn_source
from cst_cost_updates
where cost_update_id = to_number(txn_source_id);
if Type_id4 = 1 then select segment1 into txn_source
from po_headers_all
where po_header_id = to_number(txn_source_id);
select request_number into txn_source
from mtl_txn_request_headers
where header_id = to_number(txn_source_id);
select wip_entity_name into txn_source
from wip_entities
where wip_entity_id = to_number(txn_source_id);
elsif Type_id4 = 7 then select segment1 into txn_source
from po_requisition_headers_all
where requisition_header_id =
txn_source_id;
select CYCLE_COUNT_HEADER_NAME into txn_source
from mtl_cycle_count_headers
where cycle_count_header_id = to_number(txn_source_id)
and organization_id = org_id;
select physical_inventory_name into txn_source
from mtl_physical_inventories
where physical_inventory_id = to_number(txn_source_id)
and organization_id = org_id;
select description into txn_source
from cst_cost_updates
where cost_update_id = to_number(txn_source_id);