Previous Next JavaScript must be enabled to correctly display this content

## 12.7 Rendering HTML Using Custom PL/SQL

If you must generate specific HTML content not handled by Oracle APEX forms, reports, and charts, you can use the PL/SQL region type.

To generate HTML in this type of region, you need to use the PL/SQL Web Toolkit. You can reference session state using bind variable syntax. Keep in mind that when you generate HTML in this way, you do not get the same consistency and control provided with templates.

To give you more control over HTML dynamically generated within a region, you can use PL/SQL. For example, to print the current date, you could create a region with the following source:

    htp.p(TO_CHAR(SYSDATE,'Day Month DD, YYYY'));

This next example accesses tables:

    DECLARE
       l_max_sal NUMBER;
    BEGIN
       SELECT max(sal) INTO l_max_sal FROM emp;
       htp.p('The maximum salary is: '||TO_CHAR(l_max_sal,'999,999.00'));
    END;

See Also:

Oracle AI Database Development Guide

Parent topic: Controlling Page Layout