create or replace procedure get_realtime_account_data is
req UTL_HTTP.REQ;
resp UTL_HTTP.RESP;
val varchar2(2000);
real_records datacenter.common_utils.STRING_LIST;
fields datacenter.common_utils.STRING_LIST;
d_date date := to_date(to_char(sysdate, 'yyyy-mm-dd hh24:mi') ||
':00',
'yyyy-mm-dd hh24:mi:ss');
begin
UTL_HTTP.SET_WALLET('file:/home/oracle/wallet', 'wallet');
req := UTL_HTTP.BEGIN_REQUEST('https://192.168.127.1/GameMaster/GetServerInfo.aspx');
resp := UTL_HTTP.GET_RESPONSE(req);
utl_http.read_line(resp, val, true);
utl_http.end_response(resp);
real_records := datacenter.common_utils.EXPLODE(val, '|');
for i in 1 .. real_records.count loop
fields := datacenter.common_utils.EXPLODE(real_records(i), '/');
insert into stat_realtime_player_count
values
(d_date, fields(1), '', fields(2));
end loop;
commit;
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(resp);
end get_realtime_account_data;
|