|
HOWTO: Overview
of Internet Packages in Oracle Database -- UTL_INADDR
Prerequistires:
Oracle8I or later
Purpose:
UTL_INADDR Package จะมี API ที่ช่วยให้เราสามารถเขียน PL/SQL Program
เพื่อใช้ในการดึงข้อมูลที่เป็น ชื่อเครื่องและ IP Addresses ทั้งเป็น
Local และ Remote hosts
Step-by-Step Example:
Create
Anonymous PL/SQL Block
declare
host varchar2(20);
host_address varchar2(20);
begin
host := 'exzilla.net';
host_address := utl_inaddr.get_host_address(host);
dbms_output.put_line('IP address of ' ||
host || ' is ' || host_address);
end;
|
Testing
SQL> connect scott/tiger
Connected.
SQL> set serveroutput on
SQL> declare
2 host varchar2(20);
3 host_address varchar2(20);
4 begin
5 host := 'exzilla.net';
6 host_address := utl_inaddr.get_host_address(host);
7 dbms_output.put_line('IP address of ' ||
8 host || ' is ' || host_address);
9 end;
10 /
IP address of exzilla.net is 63.145.192.24
PL/SQL procedure successfully completed.
SQL>
|
Note:
Complete Sample
code:
References:
Oracle9i Supplied PL/SQL Packages and Types Reference Release
1 (9.0.1)
Part Number A89852-02
You can download from http://otn.oracle.com/
More Information:
Oracle9i Supplied PL/SQL Packages and Types Reference Release
1 (9.0.1)
Part Number A89852-02
You can download from http://otn.oracle.com/
Keywords:
http protocol , UTL_INADDR, packages
|