declare
req UTL_HTTP.REQ;
resp UTL_HTTP.RESP;
v_text varchar2(4000);
begin
--here you can insert other code even procedure or funciton
--my codeing is etl monitor
v_text := etl_monitor; --this is the etl monitor procedure
if v_text is not null then
req := UTL_HTTP.BEGIN_REQUEST(‘http://192.168.xxx.xxx/pass/web/alertsms.php?data=‘ ||
v_text);
resp := UTL_HTTP.GET_RESPONSE(req);
utl_http.end_response(resp);
end if;
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(resp);
end;
declare
*
ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1231
ORA-29263: HTTP protocol error
ORA-06512: at line 11
declare
req UTL_HTTP.REQ;
resp UTL_HTTP.RESP;
val varchar2(32767);
begin
req := UTL_HTTP.BEGIN_REQUEST(‘xxx‘);
utl_http.set_header(req, ‘Content-Type‘, ‘text/html; charset=utf-8‘);--add this
resp := UTL_HTTP.GET_RESPONSE(req);
utl_http.read_line(resp, val, true);
utl_http.end_response(resp);
dbms_output.put_line(val);
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(resp);
end;