Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL Package for generating HTML Tables
Hi Christian -
Here's a snip from a package I tooled around with to print out which Pokemon cards my son has. It should give you an idea:
begin
htp.htmlopen; htp.headopen; htp.headclose;
htp.bodyopen(cattributes=>'bgcolor="lavender"'); htp.header(3, p_name);
htp.tableopen('border="2"'); htp.tableheader('ID'); htp.tableheader('Name', 'left'); htp.tableheader('Type'); htp.tableheader('Edition'); htp.tableheader('Have it?'); htp.tableheader('How many?');
for r in
(select id, name, type,
decode(edition, 'B', 'Basic', 'F', 'First') edition, decode(have_it, 'Y', '<font color="green">Yes</font>', 'N', '<font color="red">No</font>') have_it, how_many from cards where cs_name = p_name order by id)
htp.tablerowopen;
htp.tabledata(r.id, 'center');
htp.tabledata(r.name, 'left'); htp.tabledata(r.type, 'center'); htp.tabledata(r.edition, 'center'); htp.tabledata(r.have_it, 'center'); htp.tabledata(nvl(r.how_many, 0), 'center'); htp.tablerowclose;
end loop;
htp.tableclose;
htp.bodyclose;
htp.htmlclose;
end right;
----------------------------- end snip ----------------------------------
Carla
"Christian Stauffer" <stauffer_at_infosystem.ch> wrote in message
news:3d188110$0$24062$7402020d_at_newsfeed.sunrise.ch...
> Hi,
>
> I saw the htp/htf packages of oracle. What I need is a
> function that returns full formatted HTML Code when I pass a
> select statement.
> Something like:
> ret:=sys.xyz.BuildHTMLTable ('select 1,2 from dual union all
> select 10,20 from dual');
> would return the HTML Code for a Table looking like:
> 1 2
> 10 20
>
> Is there an Oracle delivered package for such operations, or
> for anything else HTML-oriented?
>
> Please send a copy of your reply to
> stauffer<at>infosystem.ch
>
> Thanks, Christian
>
> --
> Christian Stauffer
> Infosystem AG Switzerland
>
>
>
>
Received on Tue Jun 25 2002 - 11:08:04 CDT
![]() |
![]() |