All pastes #975840 Raw Edit

Something

public text v1 · immutable
·published 2008-04-07 20:23 UTC
rendered paste body
SET serveroutput ON

DECLARE
   req      UTL_HTTP.req;
   resp     UTL_HTTP.resp;
   VALUE    CLOB;
   RESULT   CLOB;
   
BEGIN
   DBMS_OUTPUT.put_line(RESULT);
   req := UTL_HTTP.begin_request('http://cnn.com');
   resp := UTL_HTTP.get_response(req);

   LOOP
      UTL_HTTP.read_line(resp,VALUE,TRUE);
      RESULT := CONCAT(RESULT, VALUE);
   END LOOP;

   UTL_HTTP.end_response(resp);
   
   DBMS_OUTPUT.put_line('Final: ' || result);
   
EXCEPTION
   WHEN UTL_HTTP.end_of_body
   THEN
      UTL_HTTP.end_response(resp);
END;
/