The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT counter_details.counter_item_id,
counter_details.counter_name
FROM (
SELECT cnt_itm.jtot_object1_code, cont_headers.id contract_id,
cont_headers.contract_number, cnt_itm.object1_id1 counter_item_id,
counters.counter_name,line_Details.cle_id parent_service_line_id,
cnt_itm.id cntr_id , cnt_itm.cle_id
FROM okc_k_items cnt_itm
, csi_counters_v counters
, okc_k_lines_b line_details
, okc_k_headers_all_b cont_headers
WHERE cnt_itm.jtot_object1_code = 'OKX_COUNTER'
AND cont_headers.id = line_Details.dnz_chr_id
AND line_details.lse_id=13
AND cnt_itm.dnz_chr_id = line_Details.dnz_chr_id
AND cnt_itm.cle_id = line_Details.id
and cnt_itm.object1_id1 = counters.counter_id
AND cont_headers.id = p_contract_id
AND line_details.cle_id = p_cle_id
ORDER BY cnt_itm.id ASC
) counter_details
WHERE ROWNUM <2 ;
PROCEDURE inv_insert_readings_using_api ( p_counter_id NUMBER,
p_count_date DATE,
p_new_reading NUMBER,
p_net_reading NUMBER,
p_transaction_id NUMBER
)
AS
l_return_status VARCHAR2(30);
debug('In INV_3PL_BILLING_COUNTER_PVT.inv_insert_readings_using_api ');
SELECT cii.instance_id reference_number
INTO l_source_transaction_id
FROM okx_system_items_v it,
csi_item_instances cii,
cs_csi_counter_groups cg,
csi_counter_associations cca,
csi_counters_b ct,
csi_counter_readings cv
WHERE it.id1 = cii.inventory_item_id
AND it.organization_id = okc_context.get_okc_organization_id
AND cca.source_object_id = cii.instance_id
AND cca.source_object_code = 'CP'
AND ct.counter_id = cca.counter_id
AND ct.group_id = cg.counter_group_id
AND cv.counter_id (+) = ct.counter_id
AND cv.counter_value_id (+) = oks_auth_util_pvt.get_net_reading(ct.counter_id)
AND ct.counter_id = p_counter_id;
SELECT csi_transactions_s.NEXTVAL
INTO l_transaction_id
FROM dual;
l_counter_readings_tbl(l_c_ind_rdg).LAST_UPDATE_DATE := SYSDATE;
l_counter_readings_tbl(l_c_ind_rdg).LAST_UPDATED_BY := fnd_global.user_id;
l_counter_readings_tbl(l_c_ind_rdg).LAST_UPDATE_LOGIN := fnd_global.login_id;
l_ctr_property_readings_tbl(l_c_ind_prop).LAST_UPDATE_DATE := SYSDATE;
l_ctr_property_readings_tbl(l_c_ind_prop).LAST_UPDATED_BY := fnd_global.user_id;
l_ctr_property_readings_tbl(l_c_ind_prop).LAST_UPDATE_LOGIN := fnd_global.login_id;
debug('Reading updated in IB counter table');
END inv_insert_readings_using_api;