Use UTL_INADDR package to get the host name and IP address : UTL_INADDR « System Packages « Oracle PL / SQL






Use UTL_INADDR package to get the host name and IP address

 

set serveroutput on

DECLARE
  v_HostName VARCHAR2(100) := 'www.oracle.com';
BEGIN
  DBMS_OUTPUT.PUT_LINE('Address of ' || v_HostName || ' is ' ||
    UTL_INADDR.GET_HOST_ADDRESS(v_HostName));
  DBMS_OUTPUT.PUT_LINE('Name of local host is ' ||
    UTL_INADDR.GET_HOST_NAME);
END;
/



--

 








Related examples in the same category