Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Html
UTL_TCP too
---from Supplied PL/SQL Packages and Types Reference ----
The following code example illustrates how the TCP/IP package can be used to retrieve a Web page over HTTP. It connects to a Web server listening at port 80 (standard port for HTTP) and requests the root document.
DECLARE
c utl_tcp.connection; -- TCP/IP connection to the Web server
ret_val pls_integer;
BEGIN
c := utl_tcp.open_connection(remote_host => ‘www.acme.com',
remote_port => 80,
charset => 'US7ASCII'); -- open connection
ret_val := utl_tcp.write_line(c, ‘GET / HTTP/1.0'); -- send HTTP request
ret_val := utl_tcp.write_line(c);
BEGIN
LOOP
dbms_output.put_line(utl_tcp.get_line(c, TRUE)); -- read result
END LOOP;
EXCEPTION
WHEN utl_tcp.end_of_input THEN
NULL; -- end of input
END;
utl_tcp.close_connection(c);
END;
avinthr_at_yahoo.co.uk (avin) wrote in message news:<a1c3c00e.0308202331.59d4f9ad_at_posting.google.com>...
> What pacakage would I use in pl/sql in order to automate the dwonload
> of an html page. Any help will be greatly appreciated.
>
> Thanking you
> avi
Received on Thu Aug 21 2003 - 13:24:48 CDT
![]() |
![]() |