просмотр данных при минимальном кодировании :-)
create or replace procedure htp_table(p_table_name in varchar2,
p_where_clause in varchar2:='1=1',
p_order_by_clause in varchar2:=1) is
str varchar2(2000);
begin
str:= 'begin
for i in (select * from '||p_table_name||' where '||p_where_clause||' order by '||p_order_by_clause||') loop htp.p(''<tr>'');';
for i in (select user_tab_cols.column_name, t.comments
from user_tab_cols,user_col_comments t
where user_tab_cols.table_name = upper(p_table_name)
and user_tab_cols.virtual_column = 'NO'
and user_tab_cols.table_name = t.table_name (+)
and user_tab_cols.column_name = t.column_name (+)
order by column_id) loop
htp.p('<th>'||i.column_name||case when i.comments is not null then ' ('||i.comments||')' end||'</th>');
str:=str||' htp.p(''<td>''||i.'||i.column_name||'||''</td>'');';
end loop;
str:=str||' htp.p(''</tr>''); end loop; end;';
execute immediate str;
htp.p('</table>');
exception when others then htp.p(sqlerrm);
end htp_table;
доработать напильником