Queries
Queries
SELECT ne.b_party_ton_code,ne.c_party_route,c.charge_id,
ne.full_path,c.charge,to_char(c.charge_start_date, 'DD-MON-YYYY hh:mm:ss') charge_start_date,
ne.charge_start_date,ne.last_modified charge_end_date,c.invoice_txt, c.general_1, c.general_3,
ne.a_party_network_id,ne.b_party_id, ne.a_party_id,ne.general_2,ne.general_3 negeneral_3,
ne.general_20, ne.duration, ne.normalised_event_id,
nef.normalised_event_file_id, nef.filename, nef.process_start_date, nef.process_end_date,
nef.event_source
FROM charge c, normalised_event ne, normalised_event_file nef
WHERE c.account_id in ( select account_id from account where account_name = '8216196132') -- RA
this is account_id from account
--and c.invoice_txt = 'Usage Message Event' --'Voice minutes'
AND c.invoice_txt = 'National and International Voice Calls'
AND c.charge_start_date between to_date('01/01/2013 00:00:00','dd/mm/yyyy hh24:mi:ss') and
to_date('31/01/2013 23:59:59','dd/mm/yyyy hh24:mi:ss')
-- >=trunc(sysdate -60)
--and c.general_3='0,[ ],[ ],[ ]|0,[ ],[ ],[ ]|250,[ 263068967.20110625 ],[ 250 ],[ 39 ]'
--and c.general_3 like '%263068967%'
AND c.normalised_event_id = ne.normalised_event_id
AND tariff_id != '11000001'
--and b_party_ton_code
--and ne.b_party_id = '00447906902565'
--and c.charge != '0.000000'
--and charge_id=101781593493
AND nef.normalised_event_file_id = ne.normalised_event_file_id
ORDER BY c.charge_start_date
--Query to monitor:
select * from batch_processes order by 1 desc
1) Query to check the charged event in database. Put MSISDN in service_name, invoice_txt is the
charged event like sms, call etc
select srv.key_value,srv.start_date,
srv.end_date,srv.event_start_date,srv.event_end_date, srv.value as Consumed,
sda.result2_value as Allocated,sda.result2_value-srv.value left
from subtotal_rating_value srv, service_da_array sda, service_history sh
where srv.customer_node_id = 35779196 and srv.key_value = '318647487'
and sda.index1_value = srv.key_value
and sh.customer_node_id = srv.customer_node_id
and sh.service_id = sda.service_id
and sysdate between sh.effective_start_date and sh.effective_end_date
and sysdate between sda.effective_start_date and sda.effective_end_date
order by srv.key_value,event_start_date
select sh.SERVICE_NAME,
sda.INDEX1_VALUE "Free Unit Alloc Id",
rc1.abbreviation || ' / ' || rc2.abbreviation || ' / ' ||
rc3.abbreviation "Category / Type / Repeat",
sda.RESULT2_VALUE "Initial Free Units",
sda.RESULT3_VALUE "Free Unit Start Date",
sda.RESULT4_VALUE "Free Unit End Date",
sda.RESULT5_VALUE "Free Unit Priority",
sda.RESULT6_VALUE "Availability",
sda.RESULT7_VALUE "Description",
sda.RESULT8_VALUE "Persona Name",
ph.PRODUCT_NAME "Companion Product Id",
sc.SCHEDULE_NAME "HUK Bill Cycle Schedule"
from service_history sh,
service_da_array sda,
reference_code rc1, -- H3G_FU_CATEGORY
reference_code rc2, -- H3G_FU_TYPE
reference_code rc3, -- H3G_FU_REPEAT
product_history ph, -- Comapanion product list
schedule sc -- Bill cycle list
where sh.SERVICE_NAME = '0831973860'
and sh.SERVICE_STATUS_CODE = 3 -- 3: Active, 9: Cancelled
and sda.SERVICE_ID = sh.SERVICE_ID
and sda.DERIVED_ATTRIBUTE_ID = 3100047
and rc1.REFERENCE_TYPE_ID = 1000023 and rc2.REFERENCE_TYPE_ID = 3100000 and
rc3.REFERENCE_TYPE_ID = 3100085
and (rc1.reference_code*1000000) + (rc2.reference_code*1000) +
(rc3.reference_code) = sda.RESULT1_VALUE
and ph.PRODUCT_ID = sda.RESULT9_VALUE
and sc.SCHEDULE_ID = sda.RESULT10_VALUE
and sysdate between sh.EFFECTIVE_START_DATE and sh.EFFECTIVE_END_DATE
and sysdate between sda.EFFECTIVE_START_DATE and sda.EFFECTIVE_END_DATE
and sysdate between ph.EFFECTIVE_START_DATE and ph.EFFECTIVE_END_DATE
order by sda.INDEX1_VALUE desc
update ctrl_batch_jobs
set status = 'New'
where job_process_id = 1503993
and status = 'Failed'
Then
commit
If this continues to fail after restart, use the following query to determine the error, and quote this when
calling out BO on call: