Skip to Main Content
Feature Request FR-2896
Product Area APIs

35 Voters

A drop-in replacement for the HTP package for use with new Dynamic Content region

morten Public
· Dec 19 2022

Idea Summary
The new “Dynamic Content” region requires developers to rewrite existing code if they want to move to the new, refreshable region type from the existing “PL/SQL Dynamic Content”. A drop-in replacement package, tentatively called APEX_HTP, should be offered as a drop-in replacement for HTP.

Use Case
For the million instances of the existing PL/SQL Dynamic Content regions out there.

Preferred Solution (Optional)
See my blog post at

This is currently on the roadmap for a future release of Oracle APEX.



  • jochen.zehe OP9 months ago

    You got my vote here!

  • steven.feuerstein OP9 months ago

    Definitely consistent with the spirit and usual approach of the APEX team.

  • olafur tryggvason OP9 months ago (edited 9 months ago)

    I created this function around 5 years ago to grab the results from my old HTP procedures. Works well, APEX team could do a simple wrapper that does this.

      nm              owa.vc_arr;
      vl              owa.vc_arr;
      l_webpage       htp.htbuf_arr;
      l_lines         pls_integer := 9000000;
      l_result        clob;
      l_header_done   boolean := false;
      /* Initialize the OWA env */
      nm (1)   := 'SERVER_PORT';
      vl (1)   := '443';
      owa.init_cgi_env (nm.count, nm, vl);
      /* Run any htp procedures */
      /* Get the output */
      owa.get_page (l_webpage, l_lines);
      dbms_lob.createtemporary (l_result, true);
      for i in 1 .. l_lines loop
         if l_header_done = false and instr (l_webpage (i), chr (10) || chr (10)) > 0 then
            -- Taka burt request header
            l_webpage (i)   := substr (l_webpage (i), instr (l_webpage (i), chr (10) || chr (10)) + 2, length (l_webpage (i)));
            l_header_done   := true;
         end if;
         dbms_lob.writeappend (l_result, length (l_webpage (i)), l_webpage (i));
      end loop;
      return l_result;
  • nicolas pilot OP8 months ago

    Why not just add an option on the new “Dynamic Content” region for this ?

    So the region can behave like the “PL/SQL Dynamic Content” region or like the new one.

    So that we don't have to modify anything in our app.

  • morten OP8 months ago

    @pilot.nicolas That's a good point. There could be a Mode attributte, “Classic (output via htp.p)” and “Extended (function returning clob)”. Although I guess there would be some usability issues / confusion when developers don't get the region to refresh if it's in the wrong mode, etc.

  • nicolas pilot OP8 months ago

    Ideally, refresh should work in both modes…

  • morten OP8 months ago

    @pilot.nicolas But adding support for refreshable regions was the whole point of introducing the new region type, and the reason why they “had to” change the way you add content. See my blog post for details.