www.oradev.com   for Oracle developers
  Pl/sql articles   Oracle articles   Performance   scripts   Books   Documentation   Links   XML
  Articles
Number format
Sequence
Use XML in the database
Using XML functions
Oracle training
Oracle certification
Create statistics
dbms_profiler explained
How to use hints
Rename tables, columns
Scheduling in 10g
How to WAP in pl/sql
How to redirect a page
How to secure your webserver
How to use utl_http
How to Trace sessions




  How to user utl_http
With UTL_HTTP you can make HTTP requests directly from an Oracle database.
You can use this package if you want to read a webpage.
There are 2 functions to make a HTTP-request:
a) utl_http.request
This function returns 1 string with a maximum of 4000 characters.
example:
declare
    t_result
varchar2(4000);
begin
    t_result := utl_http.request('http://www.xs4all.nl/~defcom/index.html');
    -- do somthing
end;

b) utl_http.request_lines
This function returns the page in pieces, and stores these in a pl/sql table.

example:
declare
    t_part
utl_http.html_pieces;
begin
    t_part := utl_http.request_lines('http://www.xs4all.nl/~defcom/index.html');
    for i in 1 .. t_part.count loop
        -- proces t_part(i);
    end loop;
end;