Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » Oracle web cartridges, dynamically create a static page.
Oracle web cartridges, dynamically create a static page. [message #135002] Mon, 29 August 2005 06:33 Go to next message
misragopal
Messages: 125
Registered: June 2005
Location: New Delhi, india
Senior Member

Hi team, I m wking on Oracle web cartridges.
How can i dynamically create a static page and store it on server's space . so that next time i need not to generate , just pick from there....? do any one have idea...?
Re: Oracle web cartridges, dynamically create a static page. [message #135065 is a reply to message #135002] Mon, 29 August 2005 14:01 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
You can reference an existing URL and save that to file or just write your own HTML to a file using utl_file.
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:347617533333http://
In my case, my pages have lines < 255 long, so I detect line breaks using chr(10). You could use any other common tag in your html to create a newline on.

CREATE OR REPLACE PROCEDURE dump_page (p_dir IN VARCHAR2, p_fname IN VARCHAR2)
IS
   l_thepage   HTP.htbuf_arr;
   l_output    UTL_FILE.file_type;
   l_lines     NUMBER             DEFAULT 99999999;
   l_piece1    VARCHAR2 (255);
   l_piece2    VARCHAR2 (255);
BEGIN
   l_output    := UTL_FILE.fopen (p_dir, p_fname, 'w');
    --l_output := UTL_FILE.fopen (p_dir, p_fname, 'w', 32767 );
   OWA.get_page (l_thepage, l_lines);

   FOR i IN 1 .. l_lines
   LOOP
      l_piece1    := NULL;
      l_piece2    := NULL;

      IF INSTR (l_thepage (i), CHR (10)) > 0
      THEN
         l_piece1    := SUBSTR (l_thepage (i), 1, INSTR (l_thepage (i), CHR (10)) - 1);
         l_piece2    := SUBSTR (l_thepage (i), INSTR (l_thepage (i), CHR (10)));
         UTL_FILE.put_line (l_output, l_piece1);
         UTL_FILE.put (l_output, l_piece2);
      ELSE
         UTL_FILE.put (l_output, l_thepage (i));
      END IF;
   END LOOP;

   UTL_FILE.fclose (l_output);
END dump_page;
/

A dbms_job can request and save the page at intervals to refresh it.
Previous Topic: accessing multiple db with OAS Forms Service
Next Topic: Any Helppppppp
Goto Forum:
  


Current Time: Fri Mar 29 01:33:55 CDT 2024