Build query form with HTP : HTP « System Packages « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> CREATE OR REPLACE PROCEDURE query_form
  2     (p_table_txt IN VARCHAR2) IS
  3     CURSOR cur_cols IS
  4     SELECT column_name
  5     FROM   user_tab_columns
  6     WHERE  table_name = UPPER(p_table_txt);
  7  BEGIN
  8     HTP.HTMLOPEN;
  9     HTP.HEADOPEN;
 10     HTP.HTITLE('Query the ' || p_table_txt || ' table!');
 11     HTP.HEADCLOSE;
 12     HTP.BODYOPEN;
 13     HTP.FORMOPEN(OWA_UTIL.GET_OWA_SERVICE_PATH||'do_query');
 14     HTP.FORMHIDDEN('p_table_txt', p_table_txt);
 15     HTP.FORMHIDDEN('COLS', 'dummy');
 16     FOR cur_cols_rec IN cur_cols LOOP
 17        HTP.FORMCHECKBOX('COLS', cur_cols_rec.column_name);
 18        HTP.PRINT(cur_cols_rec.column_name);
 19        HTP.NL;
 20     END LOOP;
 21     HTP.FORMSUBMIT(NULL, 'Execute Query');
 22     HTP.FORMCLOSE;
 23     HTP.BODYCLOSE;
 24     HTP.HTMLCLOSE;
 25  END query_form;
 26  /

Procedure created.








31.37.HTP
31.37.1.Create HTML List tags
31.37.2.Display table names in user_tables in HTML format with HTP.PRINT
31.37.3.Use HTP package to create HTML page structure
31.37.4.HTP.PRINT with to_char method
31.37.5.Using HTP.PRINT and HTF.BR to output a HTML
31.37.6.Build query form with HTP
31.37.7.Display employee in HTML format using HTP package
31.37.8.Output a html table
31.37.9.Display records in a HTML table
31.37.10.Display records in a HTML table with parameters
31.37.11.output a form with action