Re: Use existing HTML pages from OAS
Date: Tue, 19 Jan 1999 06:33:58 GMT
Message-ID: <78190m$8al$1_at_nnrp1.dejanews.com>
Yes it is doable
Jan-Olav Eide <janolav_at_nr.no> wrote:
> I have a number of statically defined HTML
> pages that I wish to present from an PL/SQL
> application running in Oracle Application Server
> 4.0. I hope to avoid having to write dynamic
> generation of these pages using the htp/htp package,
> is this at all possible.
> Something like htp.print("Existing html page") would
> be nice, but is it doable ?
Here is an egg_sample: Note: that the request function only returns the first 2000 characters of a file, if the html file is bigger than that then you will have to use:UTL_HTTP.REQUEST_PIECES instead of utl_http.REQUEST. You would place this in a loop and test to see if you are on the last piece by seeing if the last piece is smaller than 2000 chars
- -- var to hold pieces of the html file l_data varchar2(2000);
begin
- the utl_http package allows you to read data from any web page on the www l_data := utl_http.REQUEST('http://www.mysite.com/mydirectory/mypage.html');
--this line prints the data of the web page htp.p(l_data);
--and then you need to handle any exceptions exception
when utl_http.init_failed then
return 'BAD';
when utl_http.request_failed then
return 'BAD';
when others then
return 'BAD';
END; -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Jan 19 1999 - 07:33:58 CET