Hi,
I am working with Oracle RDBMS 12c, but the original application has been migrated from 11gR2 to 12c.
I have a procedure that send and receive information using JASON protocol to and from Google:
create or replace function google_geocode( p_address varchar2 ) return sdo_geometry is
l_http_req utl_http.req;
l_http_resp utl_http.resp;
l_response long;
l_latlon long;
begin
l_http_req := utl_http.begin_request(
url => 'http://maps.google.com/maps/geo' ||
'?q=' || utl_url.escape( p_address ) || -- address to geocode
'&output=csv' || -- simplest return type
'&key=abcdef' ); -- Google API site key
l_http_resp := utl_http.get_response( l_http_req );
utl_http.read_text( l_http_resp, l_response );
utl_http.end_response( l_http_resp );
l_latlon := substr( l_response, instr( l_response, ',', 1, 2 ) + 1 );
return sdo_geometry(
2001, 8307,
sdo_point_type( to_number( substr( l_latlon, instr( l_latlon, ',' )+1 )),
to_number( substr( l_latlon, 1, instr( l_latlon, ',' )-1 )),
null ),
null, null );
end google_geocode;
/
I get the following error when I use this function:
select google_geocode('1910 Oracle Way, Reston' ) g from dual;
select google_geocode('1910 Oracle Way, Reston' ) g from dual
*
ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-12543: TNS:destination host unreachable
ORA-06512: at "SYS.GOOGLE_GEOCODE", line 8
It has somethiing to do with security and ACL that is different from 11g I guess.
Does someone can explain met hoow to set the ACL privileges for the user from which I run this PL/SQL function?
Thanks by advance for any tip.
Kind Regards