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.